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
69 views

How to generate two groups of $n$ random numbers in $U(0,1)$ such that sum of these two groups equal? [on hold]

I want to have two groups of $n$ random numbers $u_i$ and $v_i$ in $U(0,1)$, such that $\sum u_i = \sum v_i$ What I tried is: I can firstly get $u_i$ by $U\sim U(0,1)$, make $s=\sum u_i$. Then I ...
0
votes
0answers
18 views

How to generate conditioned random variables from a density function?

I want to generate random variables from a distribution function using inverse sampling with the additional condition that the sampling should be conditioned, i.e., random generated variables should ...
0
votes
0answers
11 views

Looking for an algorithm to generate (dummy) share price data [migrated]

Is there an easy-ish way I can generate "dummy" share price data for the purposes of data visualisation techniques etc.? Essentially I want to have something like the "Adventure Works" of price data. ...
0
votes
0answers
44 views

Generating random variables from a density function expression with R? [duplicate]

I am using R langage, and for my algorithm I should generate random variables knowing the expression of the density function. For exemple, the density function is : ...
0
votes
1answer
20 views

Constructing a random Experiment

Can someone help me as how to construct a random experiment which has the following density:$$\frac{1}{2\sqrt{2\pi}}\left(e^{\frac{-x^2}{2}}+e^{\frac{-(x-10)^2}{2}}\right)$$ Update: According to what ...
0
votes
1answer
29 views

Is my scatter chart random

I used =RAND()*500 in Excel and added to a scatter chart: How can I know if it is indeed Random?
0
votes
0answers
8 views

Generate random variables with predefined correlation structure AND fixing some values (followup)

This question is basically a followup to this one: Generate random variables with predefined correlation structure AND fixing some values because I can't follow the answer given there. I would like ...
3
votes
2answers
178 views

Generating samples from kernels other than Epanechnikov's

Generating samples from kernel densities with Gaussian kernel is very simple, the same with uniform, or triangular kernels. There is also a smart algorithm for generating samples from Epanchenikov ...
1
vote
2answers
58 views

How does Random Number Generation work?

I'm using the set.seed() function in R to achieve reproducability of my results. I compare different regression methods (e.g. RandomForest, SVM, GAM) by their MSE derived from a cross-validation ...
3
votes
3answers
51 views

Is it possible to generate data for stochastic process with specific distribution and autocorrelation?

It seems though that there is a disconnect between constructing paths of a stochastic process with both a specific distribution and autocorrelation. It seems like you can have either one property or ...
1
vote
1answer
38 views

Relationship between probability distribution and correlation [closed]

I'm unsure of the precise relationship between a probability distribution and correlation, in particular autocorrelation. What exactly is an autocorrelated probability distribution? It seems like ...
0
votes
1answer
23 views

Generating random variables with inverse df

Assume a distribution $X$, and we know the idf $F^{-1}$ of $X$. Let $U \sim U(0,1)$. Why is drawing an element from X according to $F^{-1}(u) = Z$ considered to be more random than just drawing an ...
1
vote
1answer
31 views

Some details about the Box-Muller transform method

I am confused about why $Z_0$ and $Z_1$ are independent. It seems like they both rely on $U_1$ and $U_2$. Could someone prove the statement?
3
votes
0answers
27 views

Generate multivariate time series

Suppose that I want to generate tri-variate Gaussian time series $\{(X_{1i}, X_{2i}, X_{3i}), i=1,2,...,n\}$ with a correlation structure across the three time series; that is, $(X_{1i}, X_{2i}, ...
0
votes
1answer
24 views

Test for RVs with known probabilities?

I have written code that generates a sequence of distinct integers. The integers are assumed to occur in the sequence with fixed probabilities. For example, if the sequence contains the numbers ...
0
votes
0answers
14 views

What are some randomness tests I can perform on a PRNG with arbitrary integral range?

I am working on developing a PRNG which transforms bits of source entropy into integers which are uniform over the range [1, N], where N is any integer greater than one. This is exactly what ...
0
votes
1answer
37 views

How to get Normal distibuted random numbers [closed]

I need to generate random numbers following Normal distribution. If X is a radius, and Y is an angle, how I can transform it into Descartes coordinates, and are they normally distributed?
0
votes
2answers
34 views

How can I output random points under a Laplacian density function in Matlab? [closed]

E.g. given a Standard Laplacian distribution: g = @(x) 1/(2*1)*exp(-(abs(x-0))/1); % Std Laplacian distribution How can I produce ...
1
vote
2answers
49 views

How do you sample data from a known distribution?

Lets say I have a known probability distribution. It could be power-law distribution or a Gaussian distribution for example. If I know the necessary parameters of the distribution, then how do I ...
1
vote
0answers
5 views

Generate sample process with CrossSectional Correlation and autoregressive structure

How can you generate a sample multidimensional time series $X_{t,i}$ for $t \in \{1,2,...,T\}$ and $i \in \{1,2,...,M\}$ where: $E[X_{t,i}] = 0$ $E[X_{t,i}X_{t,j}] = \Sigma_{i,j}$ ...
2
votes
1answer
35 views

Create random time series with shifts in R

I'm trying to create some random time series with shifts along the series. Some with normal distribution and the others with non-normal distribution (Log normal for example). For both I have to ...
2
votes
1answer
138 views

How to simulate the different types of missing data

How do you create a missingness mechanism (MAR, MCAR, NMAR)? Can you generate it directly or do you do it by a model?
7
votes
2answers
134 views

How to generate samples uniformly at random from multiple discrete variables subject to constraints?

I would like to generate a Monte Carlo process to fill an urn with N balls of I colors, C[i]. Each color C[i] has a minimum and maximum number of balls which should be placed in the urn. For ...
7
votes
1answer
165 views

How does the inverse transform method work?

How does the inversion method work? Say I have a random sample $X_1,X_2,...,X_n$ with density $f(x;\theta)={1\over \theta} x^{(1-\theta)\over \theta}$ over $0<x<1$ and therefore with cdf ...
1
vote
1answer
13 views

Odds of specific generated population of exponential distributed stochast

I'm trying to generate a sequence of samples using an exponentially distributed stochast, i.e., making a Poisson arrival process. In my specific case I generate 337 samples using a mean inter-arrival ...
0
votes
0answers
12 views

Test fitness proportionate selection algorithm implementation

I implemented a couple of algorithms for fitness proportionate selection (roulette-wheel, alias method and roulette-wheel via stochastic acceptance) and now I want to write a test to ensure that ...
1
vote
1answer
35 views

How to generate series of pseudorandom autocorrelated numbers

Say I am Ok with the numbers getting drawn from a standard normal distribution, but I also want the autocorrelation of the series at lag 1 to be a specific number. How can I generate such a series of ...
1
vote
1answer
57 views

How to generate correlated non-normal random variables?

I know that the Cholesky decomposition can be used to generate correlated normal random variables. Is there similar method to generate correlated random variables with non-normal distributions?
3
votes
0answers
21 views

differences between fake computer-generated data & real data

generally, is there a/some formula(s) or algorithm(s) to prove that a data set is a fake one generated using computer and not by field work? more specific, recently I got a research questionnaire data ...
1
vote
2answers
50 views
0
votes
1answer
68 views

How to generate random samples from joint normal distribution with R? [closed]

I want to generate random samples from normal distribution such that : $X \sim \mathcal N(u_1,s_1)$ $Y \sim \mathcal N(u_2,s_2)$ and $\mathrm{cor}(X,Y)=k$ {k is non zero}. If k=0 then X and Y can ...
1
vote
0answers
29 views

Generate numbers with specific correlation matrix

I have data for 200 respondents to 12 items likert scale(1-9). Using the correlation matrix and the means of the 12 items, i tried to simulate 1000 respondents using the syntax: ...
4
votes
1answer
46 views

Generate a random variable which follow Gamma distribution and AR(1) process simulatenously

Is it possible to generate numbers from Gamma distribution (with parameters shape=10, scale=15, say) which also follow a AR(1) process, simultaneously? If it's possible, than how to do that?
0
votes
0answers
13 views

Calculating initial distributions from resulting multivariate distribution

I have recently started working with multivariate distributions in MATLAB and I am facing the following problem: I am creating two normal distributions $X_1$ and $X_2=k*X_1$, where $k$ is a positive ...
2
votes
1answer
54 views

What is average tree size?

Suppose that you generate a sequence which stops with prob q at every step or proceeds with prob p. That is you will get bernulli sequence 0 or 10 or 110 or 11...10 with corresponding lengths 1, 2, 3, ...
2
votes
1answer
39 views

What should be the underlying distribution behind Monte Carlo simulation?

When we are trying to use Monte Carlo simulation to solve a problem that does not have analytical solution, how do we decide what should be the underlying distribution from which we draw these random ...
0
votes
1answer
57 views

Generate bivariate random numbers from joint distribution function

I have an empirical joint distribution function $ \hat{F}(x_1,x_2) = Pr(X_1 < x_1, X_2 < x_2) $ Can I generate bivariate random number from this distribution with a certain condition such as ...
2
votes
2answers
75 views

How to simulate random observations from a specific distribution?

I am asking for a general approach about how to construct algorithms akin to, for example, the rnorm function in R given that one has, say, a closed-form ...
3
votes
0answers
79 views

creating random variable with certain auto-correlation in R

I want to create a random variable with a given autocorrelation in R. The target autocorrelation is defined by: $$acf_{target}=(lag+1)^{(-b)}$$ with $b=1.41519$ which I derived from a natural ...
0
votes
2answers
48 views

How can I generate data for a GLM that explains my outcome well?

I want to test several glm methods of an outcome that follows a gamma distribution. I can generate this outcome like this: y <- rgamma(100, shape=0.5, rate=1) ...
0
votes
1answer
41 views

How to generate random points on a plane that do not overlap?

I want to generate a bunch of random dots on the (x,y) plane, where the coordinates are integers drawn from some distribution F (e.g., the uniform distribution). Each dot is a square of size SxS and I ...
0
votes
1answer
30 views

Given P(Y | X) and random samples of Y drawn from P(Y), can one probabilistically assign values of X to each Y?

Say I have a set of Y values drawn randomly from P(Y). I'd like to probabilistically assign a value of X to each Y. However, I don't know P(X|Y), but I do know P(Y|X). Bayes' theorem relates these ...
1
vote
0answers
53 views

Generating negatively correlated variables in R

I am trying to generate a set 10 normally distributed random variables that are negatively correlated with each other with $\rho=-0.5$. I've generated a covariance matrix ...
0
votes
1answer
65 views

Transform standard normally distributed numbers into arbitrary normal distribution

I need a random number generator with a normal distribution, with parameterizable mean and standard deviation. I have only a uniformly distributed random number generator. By applying a Box-Muller ...
1
vote
1answer
118 views

Random Sample from Power Law Distribution

I have a huge data set that is probably hundreds of millions of rows. This data follows a very skewed power law distribution. Consider the X-axis to be products and the Y-axis to be revenue from ...
3
votes
1answer
75 views

Why do floating point random number methods exclude 1.0 in distribution

I've been 'playing about' with pseudo random generators in C#, while studying Algorithms (Sedgewick & Wayne). I've noticed that the BCL Random class generates distributions in a 'half-open' way ...
0
votes
0answers
21 views

Generating probabilities with support -1 to 1

I have a question about data generation. It seems so simple, but is confusing me. I am trying to generate data on the probability scale with support of -1, 1. The justification of having this support ...
2
votes
0answers
17 views

Uncorrelated Real and Imaginary parts of a field in k-space: WHY?

I am in the process of generating a (real) Gaussian random field δ(x⃗ ) from a given power spectrum P(k). The way I define the power spectrum is, in Fourier space, $\left\langle \delta(\vec{k}) ...
0
votes
3answers
263 views

Generating Beta distributions with Uniform generators

I can generate as many samples from one or more uniform distribution (0,1) as I wish. How can I use this to generate a beta distribution ?
2
votes
0answers
73 views

Binomial Distribution With Scale Variable?

I'm attempting to generate some random data using a distribution. I need each random point to fall within a certain range e.g. 0-20, and I would also like to control where the center of the curve ...