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)

1
vote
0answers
17 views

Generating random samples from Huber density

Huber density, connected to Huber loss, can be defined as: $$ f(x) = \frac{1-\epsilon}{\sqrt{2\pi\sigma}} e^{-\rho_k(x)} $$ where $$ \rho_k(x) = \begin{cases} \frac{1}{2} x^2 & ...
0
votes
0answers
10 views

Subset of Pareto/powerlaw distribution

Given a set of random data generated using pareto-distribution, how can I get X% of this random data without losing pareto-distribution. In other words, how to select a subset of pareto-distribution ...
3
votes
0answers
24 views

Generating valid random correlation matrices with non-negative entries

The title is pretty self-explanatory. I need to efficiently generate correlation matrices (i.e. semidefinite-positive, symmetric and all ones along the diagonal) of size $n$, with the limit that ...
0
votes
1answer
20 views

How to interpret Monte Carlo samples of the ratio of two variables?

My aim is to find the 95% confidence interval of the ratio of two variables for which I have summary statistics. More specifically, I have the prevalence of mothers drinking during their pregnancy ...
13
votes
1answer
973 views

If so many people use set.seed(123) doesn't that affect randomness of world's reporting?

It seems like everyone just uses set.seed(123) or set.seed(1234) when they are doing random sampling. If so many people use ...
0
votes
1answer
41 views

Bayesian inference for the rate parameter $\lambda$ of an exponential with Accept Reject

Let a prior distribution be $$ \pi(\lambda)=\begin{cases} \frac{2\lambda}{3} & 0 < \lambda \le 1 \\ \frac{2}{3\lambda^2} & \lambda > 1 \end{cases} $$ This ...
0
votes
2answers
27 views

Generating data from a Beta-Binomial distribution by inverting CDF in R [closed]

I am trying to generate data from a beta-binomial distribution by inverting its cdf in R. The code I have written to calculate the cdf seems to be working fine for most cases, but gives me values ...
1
vote
0answers
18 views

How is variance controlled in a matched random assignment?

Can someone explain to me why in a matched random assignment, the variance is also controlled in addition to the mean? And if it doesn't control for the variance, is there a random assignment strategy ...
1
vote
0answers
21 views

Which random number generator is used in scikit learn and in R?

I want to generate same random numbers as used in R in my RandomForestRegressor class in scikit learn Python library. So I want to know which random number generator is used in R, and how I can ...
3
votes
0answers
14 views

Best way to check implementation of density, distribution function and random generation

What is the best way to check if implementation of density, distribution function, quantile function and random generation for some distribution are correct? For example, base R lacks Laplace ...
0
votes
0answers
11 views

Randomly erase data given sparseness

I would like to sparsify a data frame given the sparseness value. That is, I would like to randomly delete some data from the dataframe to later use an imputation algorithm to impute the missing ...
3
votes
1answer
26 views

Random generation from multivariate hypergeometric distribution

James E. Gentle (2003) in Random Number Generation and Monte Carlo Methods describes the following algorithm for random generation from multivariate hypergeometric distribution: To generate a ...
0
votes
0answers
18 views

Testing Random Number Generators(RNG)

There are numerous tests of RNGs. Consider that we tested RNG with lots of different seeds and the output is as follows: with certain seeds the RNG passes the test, with other seeds RNG doesn't pass. ...
1
vote
0answers
79 views

Generating random numbers from the skew-t distribution, problem with density plots

in another question I was trying to replicate density plots using random numbers coming from the skew-t distribution of Hansen (1994). Now I need to obtain a series of random numbers coming from this ...
1
vote
0answers
40 views

lemma proof for alias method for generating discrete random variables

I'm looking to prove the lemma written in chapter 11, page 274 of Sheldon M. Ross's Simulation, regarding the alias method for random variable generation. As a prelude to presenting the method for ...
5
votes
0answers
96 views

What are real life examples of an exploited Random Number Generator

We all know that Random Number Generators in computers don't generate true random numbers, but instead generate pseudo-random numbers. Also, some RNGs are better than others, and some are ...
1
vote
1answer
36 views

Generation of Normal Distributed Numbers (with Box-Muller method?)

I want to generate several random, normal distributed numbers. At the moment I use the Box-Muller method. I have a function that returns a single number, and for this I use the following formula: ...
1
vote
1answer
103 views

Correlation between Normal variate generations

I have a function that returns normal distributed random numbers (let's call a single number X) when I pass the parameters mean ...
0
votes
0answers
15 views

Generating Skewed Z-Scores with Kurtosis

I am looking to programmatically generate random z-scores from a distribution with a specific skew and kurtosis. Can anyone provide a mathematical technique or code (VBA or C++ preferred but I'll take ...
5
votes
2answers
251 views

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

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
1answer
47 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
48 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
21 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
38 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
11 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
192 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
71 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
60 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
52 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
27 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
34 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
25 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
17 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
39 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
41 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
62 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
39 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 ...
3
votes
1answer
384 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
150 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
827 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
15 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
13 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
40 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
102 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
29 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
52 views
0
votes
1answer
90 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
33 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: ...