The act of generating a sequence of numbers or symbols randomly, or (more often) pseudo-randomly; i.e., with lack of any predictability or pattern.

learn more… | top users | synonyms (2)

11
votes
3answers
347 views

How to generate sorted uniformly distributed values in an interval efficiently?

Let's say I want to generate a set of random numbers from the interval (a, b). The generated sequence should also have the property that it is sorted. I can think ...
2
votes
1answer
27 views

How can I generate random numbers from any given copula?

Suppose that I have a 2-dim copula function C(x_1,x_2). How can I generate bivariate numbers from this copula? For specific types of copulas, I can use 'rCopula' function of 'copula' package in R. ...
0
votes
0answers
24 views

Random number generator [migrated]

How to create a random number generator without using for loop . I want to create a random number at each call in between my program and it should result different numbers at every call in c++(code ...
1
vote
1answer
80 views

Generating random samples with bivariate t-copula

I'm trying to generate a bivariate random sample of the t-copula (using rho = 0.8), without using the "copula" package and its function "rCopula" with method "tCopula". I'm using the following R-code: ...
1
vote
1answer
28 views

Simulating r.v.'s $X, Y, X \in [0,1]: X+Y+Z = 1\;a.s.$ given we know $E[X],E[Y],E[Z]$ and $E[X]+E[Y]+E[Z]=1$ with marginal variances $\sigma^2$

I think my title says most of my question, but let me re-state: I am trying to simulate variable percentages (i.e., X,Y,Z) on the above simplex without using the Dirichlet distribution. The reason ...
0
votes
0answers
35 views

Statistical method to prove the influence of Random Number Generators in Evolutionary Algorithms

Evolutionary algorithms (EAs) that simulate the effects of "mutation, reproduction, selection, replacement, etc." often incorporate the use of Random Number Generators (RNGs). Different EAs were ...
4
votes
1answer
49 views

Generate random variables with predefined correlation structure AND fixing some values

I need to generate 4 random variables that show a predefined correlation structure Sigma AND where certain values of Vars 1-4 are fixed. As an illustrative example, consider the variables: ...
3
votes
1answer
58 views

Generate random correlated categorical variables

Lets say I want to generate 100 observations of 2 likert scaled, normally? distributed variables with 10 categories (1-10) and a pearson correlation of f.e. ~0.8. I am aware that using pearson ...
3
votes
1answer
20 views

Generating Random Zero-truncated Negative Binomial Values using Rejection Sampling

I am interested in generating zero-truncated negative binomial random variables using some sort of rejection sampling. My first thought was to simply draw from a negative binomial distribution, and ...
1
vote
1answer
22 views

Collective randomness of data generated using different seeds

We are generating 5 random numbers for every object we process - this is Java, but the code is pretty easy to follow (docs): ...
2
votes
1answer
142 views

generate a time series comprising seasonal, trend and remainder components in R

I want to generate a time series comprising three components: a seasonal component, a trend component and a remainder component. Moreover, I want to be able to chnage the level of trend, seasonality ...
0
votes
0answers
12 views

Synthetic Minority Oversampling with Binary Features in the data

I am planning to use SMOTE or ADASYN for creating synthetic observations for a classification problem as the data is imbalanced. The question is, there are Binary variables in the Feature set, and I ...
10
votes
4answers
295 views

How to generate a large full-rank random correlation matrix with some strong correlations present?

I would like to generate a random correlation matrix $\mathbf C$ of $n \times n$ size such that there are some moderately strong correlations present: square real symmetric matrix of $n \times n$ ...
0
votes
1answer
51 views

Randomly constructing a probability distribution for simulation

For a simulation, I want to construct the probability distribution of a random variable $X_k$ that takes only finite number of values $x_1, \cdots, x_N$. I have to assign values to each probability: ...
3
votes
1answer
52 views

References and Best practices for setting seeds in pseudo-Random Number Generation

In this document, that concerns the "set seed" command, Stata people discuss issues related to the setting of seeds when generating pseudo-random numbers. A notable "don't" is "don't use serially ...
10
votes
1answer
222 views

How to generate random points uniformly distributed in a circle?

I was attempting to simulate injection of random points within a circle, such that any part of the circle has the same probability of having a defect. I expected the count per area of the resulting ...
7
votes
2answers
444 views

Why doesn't runif generate the same result every time?

Why is it that random number generators like runif() in R don't generate the same result every time? For example: ...
0
votes
0answers
15 views

Random character generator: often vs. rarely occurred character rate

We need to determine if a random character generator function is BAD or not. With this random character generator, we can create lines with 8 random characters. We created statistics about the ...
6
votes
2answers
89 views

Natural example of bad results with a Lehmer Random Number Generator

I tell my students every year that there’s some correlation between successive draws in a Lehmer RNG, so they should use a Mersenne Twister or Marsaglia’s MWC256... but I am unable to provide a ...
1
vote
0answers
15 views

Unifirom distribution from secure random number generator?

I'm testing a Range function from big integer software libraries. The function will return an integer in the range [0,k), where ...
1
vote
0answers
14 views

How do i generate variables that are relevant only for some classes? [closed]

I want to generate data for classification. I've generated data with 10 variables with two are relevant for all classes and 8 noise. now, I want to generate variables that are relevant just for some ...
1
vote
1answer
277 views

R: random sampling for multivariate normal and log-normal distributions

I want to generate random monthly (m) temperature (T) and Precipitation (P) data considering that both variables are intercorrelated (rTP[m]) The tricky thing is that my random variables that have ...
4
votes
1answer
113 views

Generate pseudo-random overdispersed Poisson numbers

I have multiple sets of data which conform to overdispersed Poisson distributions which I can model with the alternative parameterization of a negative binomial distribution ($\mu$ and $D$ instead of ...
1
vote
0answers
68 views

How is the constant in Marsaglia's xorshift* RNG determined?

I get Marsaglia's basic xorshift RNG. For further randomness he suggests multiplying the result by a "suitable constant." This is some code I've found that does just that: ...
2
votes
1answer
44 views

Are all sequences of of random (uniform) numbers also uniformly distributed?

If I take some sequences of random numbers generated by a random number generator with uniform distribution, will the resulting sequences be uniformly distributed as well? By example, if I have a ...
6
votes
1answer
401 views

Generate random numbers following a distribution within an interval in R

I need to generate random numbers following Normal distribution within the interval $(a,b)$. I know the function rnorm(n,mean,sd) will generate random numbers ...
3
votes
3answers
106 views

Tool for generating correlated data sets

Does anyone know of a tool that I can use to generate a set of data with known correlations (and to put the icing on the cake - output this in json,csv,txt or some common format)? I am working on ...
1
vote
0answers
20 views

Generating hyperbolic variates

How do you simulate from the hyperbolic distribution? The Wikipedia article on it does not describe how to do so. I know that the hyperbolic distribution is a special case of the generalized ...
1
vote
1answer
174 views

Sampling from a lognormal distribution

Suppose we are given $\mu$ and $\sigma$ for a lognormal distribution with random variable $X$. $\mu$ is the mean of the variable's logarithm and $\sigma$ is the standard deviation of the variable's ...
2
votes
1answer
44 views

Misconceptions about random numbers in a range

I am currently working on a project the includes fitting. For the fitting I would like to try uniform random starting parameters. The possible fit parameters can lie in quite a large range, for ...
3
votes
2answers
154 views

Generate random number from a piecewise exponential distribution

I would like to generate a random number from a piecewise exponential distribution. I consider that the time-scale is divided in $J$ intervals with bounds $(s_{j-1},s_j]$, for $j=1,...,J$, and ...
0
votes
1answer
84 views

Generate data from a bivariate power-law distribution in R

I need to generate data from a random vector that follows a bivariate power-law: $$ f_{X,Y}(x,y) = \frac{C}{XY} \left(\frac{X}{X_0} \right)^{-\alpha} \left(\frac{Y}{Y_0} \right)^{-\beta} , $$ where ...
3
votes
0answers
63 views

What kinds of PRNG exist outside Linear congruential generators?

I'm kinda running out of words, Linear congruential generator are really low quality PRNG but it was all I needed for some basic stuff, now I need to fill the blank and get to know other families of ...
1
vote
4answers
75 views

Are integer results from random number generators unlikely?

If I generate a random float value between 0…1, say to 40 digits, or n digits, aren't the chances of getting a true zero (0) or a true one (1) incredibly small? On the zero condition, every 0–9 digit ...
3
votes
1answer
82 views

How to get only positive values when imputing data?

Suppose age is normally distributed with mean 20 and standard deviation 5. How do you ensure that you get only positive values when you sample age from this distribution? I am trying to impute ...
0
votes
1answer
47 views

How can I do a chi-square test without being given the critical value table?

I have a random number generator that generate integers within [0, r). I want to write a piece of code to test whether the numbers from it are truly uniformly ...
6
votes
1answer
135 views

Is there a name for this process/ distribution?

Does the equation below have a name, or is it similar to some other well-known process/ equation? Equation of interest: $$S_c = S_{c-1} + S_{c-1}\omega_c\delta_c$$ $\delta\sim\mathcal{N}(0,1)$ is a ...
0
votes
1answer
102 views

R-commander. Generate random data depending on the means and SDs of different populations

I have 3 different populations, represented by their specific means and SDs. So I have 3 means with their 3 SDs: Mean1 = 5.5 SD1 = 0.65 Mean2 = 5.9 SD2 = 0.32 Mean3 = 5.4 SD3 = 0.49 If I want ...
2
votes
3answers
107 views

impossible distribution statistics?

I'm currently reviewing an article where authors presented distribution statistics that look erroneous to me. But I'm not able to find a way to ascertain it. The article presented results with a mean ...
1
vote
1answer
101 views

Creating data that follows a specific data distribution

I have a variable z which has around 3000 values between 0.0 and 0.5. I have plotted here z in the y-axis and 3000 evenly spaced numbers over the interval 0.0 and 0.5 in the x-axis so that one can ...
4
votes
1answer
573 views

Simulate regression data with dependent variable being non-normally distributed

For regression analysis, it is often useful to know the data generating process to check how the used method works. While it is fairly simple to do this for a simple linear regression, this is not the ...
0
votes
1answer
51 views

Generating gamma random field with given covariance matrix

I have to generate multivariate gamma distributions with given positive-definite covariance matrix. Anyone can suggest me a method? Thanks,
4
votes
1answer
45 views

Best way to generate Gaussian Field

I have to generate a homogeneous Gaussian Field with given correlation function of each points on a three dimension grid (500 x 500 x 500). A Cholesky decomposition method fails because of huge number ...
0
votes
0answers
21 views

Generating random field

I want to learn how to generate a random field with long-range spatial correlations and the underlying distribution being a beta distribution. EDIT: Is it possible to take a random Gaussian field, ...
0
votes
0answers
29 views

How can people emulate a RNG; Give the 'most random' sequence of numbers

Not sure if I should ask this at math or here but anyway. I am wondering what we as people could do if we were asked to produce a random sequence of numbers (let's say between 1 and 1000). I'd say it ...
4
votes
1answer
67 views

Testing if code is generating random variables consistent with theory

In software development, we often write unit tests to ensure that a particular portion of the code is working as expected. For example, consider the problem of drawing a color at random from ...
5
votes
2answers
206 views

Test the randomness (uniformly distributed) on a 64 bit float random generator

We have a random number generator which is supposed to generate 64 bit floats, uniformly. We want to test whether it is a good uniformly random. I am not asking the general way to test it, as it was ...
3
votes
2answers
308 views

Choosing a discrete non-uniform distribution for generating random integers

I have a list $l$ containing integers in the range $[1,max]$ On list $l$ I do an operation $isPresent(x)$ which return true if ...
2
votes
1answer
104 views

Using Poisson distribution to generate random integers

I'm trying to generate random integers which have Poisson distribution. The open source library GSL has one such distribution. Function: ...
0
votes
1answer
31 views

In testing random numbers, what other tests should I use to complement the Kolmogorov-Smirnov? [duplicate]

I'm using the Kolmogorov-Smirnov test to test a random number generator. I'm wondering if there are other tests that I should implement as well. So far, I've looked at the equidistribution and serial ...