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
49 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 ...
4
votes
2answers
43 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
129 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
60 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
27 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 ...
2
votes
1answer
58 views

How to draw estimates based on variance covariance matrix?

Suppose I fitted a logistic model and get the estimates as well as their vcov matrix. I would realize this: draw length($\beta_s$) independent $\mathcal N(0,1)$ ...
3
votes
5answers
624 views

How do I get “V-shaped” distributed random numbers from uniformly distributed numbers?

I have 1000 uniformly distributed random numbers. How do I manipulate them to get a V-shaped histogram?
2
votes
1answer
30 views

How many times, in expectation, am I fetching a random sample from a predefined discrete probability distribution of elements?

As part of a simulation that I'm working on, I have a probability distribution over $n$ elements, from which I have to sample a set $S$ of size $m$. That is, each element $e \in S$ must be unique ...
0
votes
0answers
24 views

How to test a Random Number generator in R? [duplicate]

I have a random number generator of U(0,1), I apply the ks test on x, which has 10000 random numbers in [0,1]: > ks.test(x,"punif") and obtain this result: ...
16
votes
2answers
1k views

What's the probability that from 25 random numbers between 1 and 100, the highest appears more than once?

In many online games, when players complete a difficult task, sometimes a special reward is given which everyone who completed the task can use. this is usually a mount (method of transportation) or ...
0
votes
0answers
25 views

how to generate correlated random number series? non-gaussian, empirical distributions

I have N time series, let's say $X_{it}, i=1..N$. Assuming that they're i.i.d., I want to generate N random i.i.d. series $X_{it}^*$, which would be similar to my original series $X_{it}$. If I knew ...
6
votes
2answers
73 views

Accurately generating variates from discrete power law distribution

What are the best methods to accurately generate random integers distributed according to a power law? The probability of getting $k$ ($k=1,2,\ldots$) should be equal to $p_k = k^{-\gamma} / ...
1
vote
0answers
13 views

Corrective random generation to fit a preset distribution when combined with biased data

I have a source of data that will have an unknown distribution. I want to generate "random" data such that, when I combine the two, the overall distribution completely hides what the original data's ...
0
votes
1answer
29 views

sampling for estimation - using random numbers - homework help

I have a figure like so : Now the question asks to 1) generate 100 samples of iid - 2D uniform random variables in the unit-square. 2) count how many samples generated fall within the quarter ...
0
votes
1answer
92 views

How to generate random variables from a defined density via R?

Given probability distribution: $f_x(x)=(x+1.5)^{-1.75}e^{-x/400}$, Let $t=x-1.5$. (I want to generate a random set $x$ from this distribution) Generate ...
4
votes
1answer
146 views

Random number-Set.seed(N) in R

I realize that one uses set.seed() in R for pseudo-random number generation. I also realize that using the same number, like set.seed(123) insures you can reproduce results. But what I don't get is ...
1
vote
0answers
23 views

Multinomial goodness of fit

Suppose I generate a multinomial distribution with probabilities $p_i$, i from 1 to k. Now suppose I test it back using goodness of fit (chi square) with the probabilities we know. I read that this ...
1
vote
1answer
49 views

Establishing the lack of randomness in lottery number selection

Related to this question, if I have 1500 or so jackpot results from a 6/49 lottery (numbers drawn, number of winners and prize per jackpot winner), how can I demonstrate that some numbers are less ...
0
votes
0answers
26 views

Why does this simulation of prediction accuracy and volatility returns weird results?

This is a simulation of the effects of prediction accuracy and volatility but it's results show that accuracy jumps drastically around a change in decimal points for the volatility. The output shows ...
1
vote
1answer
32 views

Interpreting “good figures of merit” in xorshift* context

I am trying to implement an xorshift* PRNG (practically an xorshift with a multiplication step in the end) as a long term replacement of Java's Math.Random. I have been reading an article pointed out ...
1
vote
0answers
28 views

Optimising test re-test reliability through randomly generating hypothetical repeated trials

I have had a look around the forum, and despite some similar questions on measurement error, no one appears to have asked this question specifically. I have developed a test where a small group of ...
1
vote
0answers
45 views

Simulation of random correlated numbers with dense covariance matrix

As you know, we can generate random correlated numbers with the Cholesky factorization: $Cov = L.L^T$. But it seems when the correlation length is large, so that the covariance matrix is dense, this ...
0
votes
1answer
34 views

Selecting uncorrelated samples from a set of bulk data that contains correlated and dependent samples

i have a set of data that is generated by expensive computational model evaluations, on a total data set of 10000 samples in 40 dimensions. This sample data set is composed of different data sets, ...
3
votes
0answers
64 views

Am I creating bias by using the same seed over and over

In almost all of the analysis work that I've ever done I use: set.seed(42) It's an homage to Hitchhiker's Guide to the Galaxy. But I'm wondering if I'm ...
2
votes
0answers
25 views

Transforming a uniform-on-sphere random vector

Consider the 3-D real random vector $(X_1,X_2,X_3)$ which is uniformly distributed on the surface of a unit sphere. What can be told about the distribution of $(aX_1,bX_2,cX_3)$, where $a,b,c,$ are ...
6
votes
1answer
332 views

How can I generate uniformly distributed points on a circle?

I am looking to generate 450 data points in R. There are three distinct sets 150 of each distributed in a circular band with different radii (at 1, 2.8 and 5). In particular, I'm looking to reproduce ...
2
votes
0answers
55 views

Generating Random Vectors with Arbitrary Marginal Distributions via NORTA

When generating random variates from different marginal distributions using the NORTA (Normal-to-Anything) method, as described in Cario & Nelson 2007, why is $\varrho$ required? To adjust ...
9
votes
2answers
465 views

Why is the distribution of rand()^2 different than of rand()*rand()?

In Libre Office Calc, the rand() function is available, which chooses a random value between 0 and 1 from a uniform distribution. I'm a bit rusty on my probability, ...
0
votes
0answers
10 views

enrichment test and relations between variables

I'm in a situation in which I derived a list of 500 genes using a sophisticated method, of which I found a subgroup of 60 genes that are mutated according to a mutational annotation. To verify the ...
3
votes
2answers
61 views

select words randomly in proportion to their frequencies

I have a large text and I need to select words randomly in proportion to their frequencies. A raw method is to put all the words in an array (N indexes) and to use a random (uniform) generator to ...
3
votes
1answer
112 views

Generating normal random samples given covariance matrix and observations on some components?

Suppose we have n by n covariance matrix of n normal random variables. Is there program where we plug in sample values for k of the n variables and the program, by using the covariance matrix and ...
1
vote
0answers
56 views

How to test the randomness of a sequence of real m-tuples?

1) Let $\{a_i\}_{i = 1, ...,n}$ be a real sequence generated by a pseudorandom number generator. How can I check the randomness of such real numbers using, for instance, Runs test? 2) Assume three ...
0
votes
0answers
91 views

Sample from Wishart distribution with inverse Scale matrix

I tried to model precision matrix in a hierarchical Bayesian setup with Wishart prior given d.f. and inverse scale matrix, and matrix normal likelihood, since it's a conjugate prior, my posterior on ...
2
votes
0answers
174 views

Generate data from a t-distribution with specified mean and standard deviation

How does one randomly sample from a T-distribution in R. From what I've found, the function rt in R doesn't let you specify the mean and standard deviation. For a ...
3
votes
1answer
165 views

How to generate random data that conforms to a given mean and upper / lower endpoints?

I'm in need of generating a set of random numbers (between 100 and 300 would suffice), which conform to a given mean, and also fall within certain upper and lower endpoints. Using the statistics ...
5
votes
1answer
235 views

Generating survival times for a piecewise constant hazard model with two change points

When there are two change points in a piecewise constant hazard model then the density function becomes some triangle exponential distribution. In this situation I can't generate the survival time ...
0
votes
1answer
62 views

Generating random variable from density function

How can I generate a random variable of size n= 2914 if I have the density function?. So the problem is that I have the density f(x) (function well defined) ...
4
votes
1answer
77 views

Simulating data to fit a mediation model

I am interested in finding a procedure to simulate data that are consistent with a specified mediation model. According to the general linear structural equation model framework for testing mediation ...
7
votes
2answers
178 views

Generating causally dependent random variables

I'm trying to generate sets of causally connected random variables and started off doing this with a monte carlo approach. The baseline is a 2-dimensional measured histogram from which I draw random ...
0
votes
0answers
238 views

Generate random variables from the Gumbel distribution in R

I want to generate 1000 random numbers with Gumbel distribution (extreme value distribution type 1) with known parameters $m$ and $a$. Then I want to estimate the parameters of the distribution for ...
5
votes
1answer
72 views

Is it correct that no statistical simulation is done using $2^{256}$ (or more) outputs from a MWC prng?

In a conversation about Marsaglia's Multiply-With-Carry pseudo-random number generator and its potential use in generating random data for statistical purposes, someone said: There is no ...
5
votes
3answers
936 views

Simulating random variables from a mixture of Normal distributions

How can I sample from a mixture distribution, and in particular a mixture of Normal distributions in R? For example, if I wanted to sample from: $$ ...
3
votes
1answer
109 views

Why should random numbers be drawn from a distribution?

What does it mean to draw a number at random from a normal distribution? Why can't you just "draw" numbers at random? Why do you have to draw random numbers from a distribution?
1
vote
2answers
143 views

Generating random numbers based on partial correlation data

I need to generate random numbers based on already existing partial correlation data (not correlation or covariance data). Specifically, a 168*12 matrix based on a 12*12 partial correlation matrix. ...
1
vote
1answer
173 views

NIST randomness test fails in random generated bits

I am using the NIST randomness test suite which checks whether a bit sequence is random over 15 different tests. I have problems in verifying if this suite works fine. The situation is that if I ...
4
votes
3answers
551 views

Generating random numbers from a t-distribution

How can I generate random numbers that follow a student-t distribution? From several sources I understand that this can be done using a random sample of size $n$ drawn from a normally distributed ...
2
votes
2answers
423 views

How do I test if two random variables are independent

I'm trying to understand the concept of independence experimentally using computer simulation. I imagine to understand this concept: I should be able to generate three data sets from random ...
4
votes
1answer
76 views

Generating discrete uniform from coin flips

Suppose you have a fair coin which you can flip as many times as you want (possibly countably infinite). Is it possible to generate the discrete uniform distribution on $(1,2,...,k)$, where $k$ is NOT ...
1
vote
1answer
114 views

Using Random Number Table

In a random number table , the random numbers are given as first thousand, second thousand, third thousand, and so on. Every thousand has 25 rows and 1 to 4, 5 to 8 up to 37 to 40 columns. Suppose ...
4
votes
0answers
63 views

Advice on comparing methods of generating random vectors

I'm researching a method for sampling uniformly from an $n$-dimensional shape, for which conventional rejection sampling may be too slow. I am generating 1,000 points using each method, and wish to ...