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)

4
votes
1answer
47 views

Handle random orthogonal matrix determinant

I've got probably a silly question about which, I must confess, I'm confused. Imagine repeated generating of uniformly distributed random orthogonal (orthonormal) matrix of some size $p$. Sometimes ...
5
votes
1answer
47 views

Simulate from a truncated mixture normal distribution

I want to simulate a sample from a mixture normal distribution such that $$p\times\mathcal{N}(\mu_1,\sigma_1^2) + (1-p)\times\mathcal{N}(\mu_2,\sigma_2^2) $$ is restricted to the interval $[0,1]$ ...
0
votes
0answers
6 views

Generating a random field from given power spectrum

How can I generate a random field in configuration space from a given power spectrum P(k)? I guess the variance of the distribution from which I extract the values of the field should be related in ...
1
vote
0answers
35 views

rnorm vs numpy.random.randn

For a regression example, I constructed some artificial data and ran ols, ...
2
votes
0answers
24 views

Generating Random Sample to Fit LM Output

I am trying to reverse generate a dataset that led to a certain R lm() output, l I tried to generate random sample like this, and ran lm() ...
2
votes
0answers
28 views

Uniformly distributed numbers (between boundaries) that sum to unity

Suppose I want to sample N values (uniformly) between 0 and 1, subject a sum-to-one constraint. One possibility would be to use a reject-step: ...
0
votes
0answers
49 views

Generate complex random vectors distributed as $\textit{proper}$ Complex Gaussian

This is different from this and this question. How can we generate (in Matlab) complex random vectors which are distributed according to the proper complex distribution $\mathcal{CN}(\vec\mu, ...
2
votes
1answer
43 views

How to draw a random sample from a Generalized Beta distribution of the second kind

For microsimulations, I (i) want to estimate parameters of an empirical distribution and (ii) draw a random sample based on the estimations. My random variable $Y$ seems to follow a Generalized Beta ...
2
votes
2answers
161 views

Given a series of numbers, generate new numbers that are “similar” to the original numbers

I'm a programmer but I don't know much about stats, so please excuse me if this question sounds naive. I have two computers that are in different locations. I have made N measurements for the ...
3
votes
0answers
19 views

Generating column stochastic random matrix with target row sums

I want to populate a 0-1 matrix, which is an adjacency matrix, corresponding to a directed graph, with weights on the elements that are 1. In other words, I want to generate an $N\times N$ matrix $A$ ...
-1
votes
1answer
53 views

generate random exponentially distributed X data between zero and a max value [closed]

For my work issues, I need to generate random exponential distributed X data between zero and a max value. In my specific case range is (0,750) I know about inverse distribution function (IDF) for ...
-1
votes
3answers
44 views

random whole number generation for a vector size 1 to 10

I am using the sample function in R -- x <- sample(1:10, 3, replace=F) -- to generate random numbers. I want to generate ...
2
votes
1answer
55 views

How do I generate two correlated Poisson random variables?

How would I simulate observations from a bivariate Poisson distribution such that they have a nonzero covariance? The hint I was given is that I need to use the fact that the sum of two Poisson random ...
0
votes
0answers
14 views

Method or Algorithm to produce near-accurate probability selection

Are there any known algorithms or methods to accurately identify, using random occurrences, the most probable next occurrence(s) as a pre-determined length of number set, by providing an already ...
8
votes
1answer
468 views

Does Monte Carlo == apply a random process?

I never had a formal statistics course but due to my line of research I'm constantly coming across articles which apply several statistical concepts. Often I'll see a description of a Monte Carlo ...
11
votes
3answers
389 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
47 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. ...
1
vote
2answers
144 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
30 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
37 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
68 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
74 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
35 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
28 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
261 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
16 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
381 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
54 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
74 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
422 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
486 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: ...
4
votes
2answers
82 views

Generating data with a given sample covariance matrix

Given a covariance matrix $\boldsymbol \Sigma_s$, how to generate data such that it would have the sample covariance matrix $\hat{\boldsymbol \Sigma} = \boldsymbol \Sigma_s$? More generally: we are ...
0
votes
0answers
28 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
121 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
17 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
490 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
168 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
102 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
570 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
140 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
229 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
55 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
199 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
111 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
66 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
76 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
164 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 ...