Questions tagged [random-generation]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
29 views

What is the name of this simple discrete sampling algorithm?

I have a vector of probabilities $p \in \mathbb{R}^n$ which I have never seen before. I would like a single sample from the indices $(1, 2, \ldots n)$ according to the distribution defined by $p$. ...
0
votes
0answers
10 views

Generating random values from a multivariate skew-normal with fixed marginals

I'm generating random values from the multivariate skew-normal, and I want that the marginal distributions from this multivariate one have fixed parameters as the following: I'm generating from ...
0
votes
0answers
16 views

Generating Data so that the Mean is a Multiple of 1/4 [on hold]

I need to generate n numbers between 0 and 10 that are multiples of 1/4 AND I need to ensure that the mean of those n numbers is a multiple of 1/4. Can anyone suggest an algorithm to do this? ...
0
votes
2answers
36 views

how to generate random data based on simple statistical meassures

0 I currently have a test data set that has 500k data points. I have an algorithm that process that data and returns some information. In order to establish the statistical significance of the ...
0
votes
0answers
26 views

Generating data between two time series observations [on hold]

I have a time series data-set which is monthly and have got just 48 odd observations.I want to generate daily data between each two observation.,i.e. say 30 daily points between two monthly points. ...
0
votes
0answers
13 views

Random variates generation for disrecte distribution by inverse transform method [duplicate]

I have solved this question but still confused. I don't know whether this method is correct or not and also the answer which I get is right or wrong, as I was told to generate random variates for ...
0
votes
2answers
26 views

Does rowwise distribution of random values in creating a normally distributed vector variable in matrix(rnorm(.), byrow=TRUE) damage normality?

(Reprodicible example added) 150-character-limitless full question is: Does the rowwise distribution of values in creating a normally distributed vector variable via ...
1
vote
1answer
49 views

Gamma Distribution for generating random numbers

I defined a gamma distribution with following parameters: shape,scale = 4.2503, 7037. This dribuation is used to generate random numbers. The random numbers will be recalculated to the x-asix value. ...
0
votes
1answer
15 views

How to use poisson to estimate arrival time (generate random integers)?

In my assignment, I'm supposed to use a distribution curve to describe how many minutes will the employee come to work in advanced or later than the planed start time. I decided to use Poisson ...
1
vote
0answers
30 views

Generating new(fake) probability distributions based on many sample probabilty distributions

I wish to be able to generate new probability distributions that incorporate the characteristics of many sample distributions available to me. I currently have data for the individual daily return ...
0
votes
0answers
23 views

How to Incorporate Skew Into Simulated Data?

Suppose I have a dataset $\mathbf{X}$ which is a $n \times m$ matrix of $n$ independent realizations of some $m$-dimensional random vector $\mathbf{x}$. I want to generate a new dataset $\mathbf{X}'$ ...
4
votes
1answer
78 views

Transforming a uniform random variate to points on a circle

Sample $U \sim \text{Uniform}(0,\sqrt{2}-1)$. Accept $U$ with probability $1/(1+U^2)$ (else reject and sample again). Set $X = 2U/(1+U^2)$ and $Y = 1-UX = (1-U^2)/(1+U^2)$. With probability 1/2, ...
4
votes
1answer
60 views

Randomization in an RCT: How harmful is it to try different RNG seeds?

Background I was asked to perform the randomization for a small study with 3 conditions $A$, $B$ and $C$. The three conditions are three different smartphone types. The participants enter the study ...
1
vote
0answers
18 views

Is this scaling algorithm viable?

I just came up with my own random number scaling algorithm (and I'm sure someone else has come up with it before me), and I wanted to see if any of you can find holes in it. The idea is to take a ...
2
votes
2answers
35 views

High-accuracy RNG

I need to simulate a sample of size 100x3 of white noise (normal with null mean and unitary variance) I'm actually using Mersenne-Twister but discussing with my Professor seems is not "very stable" ...
0
votes
0answers
61 views

Getting sets of random correlated variables

For the training of a machine learning model I need to add additional features, and these features are correlated. I need to run the model N times adding these features with random values, and for ...
1
vote
0answers
12 views

Reducing estimation noise from several random draws

I was reading a paper in connection with preparing my thesis defense, where I stumbled upon a methodologic choice that I cannot fully understand. For context, assume a group of 16 firms exists. The ...
0
votes
0answers
23 views

Can I increase the sample size by generating random numbers to apply the Chi-Square Goodness of Fit Test?

Does increasing the sample size by random number generation change the distribution? I have a sample of size 8. Each sample value represents the number of bus arrivals at a bus stop every 15 minutes. ...
2
votes
1answer
30 views

Proper way to generate random seeds for Montecarlo runs [closed]

I am running a SIMULINK model which has noise additions. At this moment we have a variable called seed which is initialized at zero. seed = 0; Then for every ...
0
votes
0answers
12 views

How to check if a sequence's subsequences (trigrams) are random using a Monte Carlo experiment?

Let's say I have a process that produces sequences. I might have another process (or processes) that will add their own output to the data sequences at random points. To check if a subsequence (any ...
0
votes
0answers
37 views

Is pseudorandom number generator testing atypical?

Particular pseudo-random number generators are tested for their their ability to produce sequences of numbers that behave like values of independent variables that are each uniformly distributed on [0,...
1
vote
1answer
37 views

Re-scaling of exponentially distributed random numbers

I am trying to generate $M$ random numbers which are exponentially distributed and whose sum adds up to $N$ (for simplicity, $N=1$). I found that the generated numbers are initially exponentially ...
1
vote
1answer
48 views

How to check if a distribution is different from uniform distribution using the values only?

I have a discrete empirical distribution, where the values D1 = {1,2,3,7,9,15,16,17,18,19,20} occurs with some different frequencies. The frequencies are not of interest to me. I am interested in how ...
1
vote
0answers
57 views

How to get a random function with a truncated normal distribution? [duplicate]

My goal is to have a function that given an input value will output a random value that follow a truncated normal distribution, could you please suggest a function that can do that ? Or guide me a ...
0
votes
1answer
68 views

How to choose the best method to generate random values [closed]

In my specific case, I have a pdf that has no closed form, and I want to generate random values ​​of this distribution. It depends on a summation that goes to infinity (coming from a poisson process) ...
1
vote
1answer
22 views

Using quantiles to generate a sample of data

I have been given quantiles (min, 25%, med, 75%, max) for items of data, along with the size of the data n. From these pieces of information I would like to obtain a random sample of data points. ...
2
votes
1answer
25 views

Optimal distribution for Acceptance Rejection Sampling

For some project I have been sampling from the Gamma distribution. I have been using the exponential distribution intensively. One method I have employed is the Acceptance rejection sampling, ...
2
votes
0answers
22 views

How do I generate a random variable whose CDF is the product of given CDFs?

I am looking at a finite set of independent random variables ${\left\{ {{X_i}} \right\}_{1 \le i \le n}}$ with CDF ${F_i}$, with the aim of generating a random variable such that it has the CDF ${G_1}(...
17
votes
4answers
285 views

Draw integers independently & uniformly at random from 1 to $N$ using fair d6?

I wish to draw integers from 1 to some specific $N$ by rolling some number of fair six-sided dice (d6). A good answer will explain why its method produces uniform and independent integers. As an ...
3
votes
1answer
77 views

How to generate a data sample along a annulus (between fixed radii)? [duplicate]

I would like to create a random data sample to test a clustering algorithm using python. One specific data sample I would like to generate consists of two non-overlapping annuluses (annuli?); however, ...
1
vote
1answer
29 views

Generating three random numbers from normal distribution using 3 independent uniform numbers

Each of the variables A,B,C follows a normal distribution with E(A)=E(B)=E(C)=1,V(A)=1,V(B)=2,V(C)=4. Correlation between A-B=0.2,B-C=0,AC=0.8. We are given three independent uniform (on[0,1]) random ...
2
votes
1answer
41 views

wigner semi-circle distribution random numbers generation

I am trying to generate random numbers in Wigner semi-circle distribution. Since this one does not have the analytical solution for the inverse function of the pdf. I wonder if anyone familiar with a ...
1
vote
1answer
78 views

Generating multivariate normal random variables only using unif

How can I generate n multivariate normal random variables only using the runif function (with mu and sigma). I know how to use box muller transformation, but not sure where to go from there once ...
1
vote
1answer
48 views

Books for self-learning about statistic Simulation?

Preferably an introductory book, i.e. for undergrad (or notes or something like that) that explains concepts with detail and with lots of examples, without losing the formality. That covers the ...
1
vote
1answer
17 views

Randomly choosing objects from a set of objects - guarantee all objects are picked at least once?

I got into a debate with someone in class over an experiment that was claimed to be randomized. The experiment was such that there is a bucket of distinct objects, and objects were being "randomly" (...
0
votes
0answers
154 views

Simulate data that arise from mediation with specified conditions

I am looking to create a function that simulates data arising from a mediation process, where a predictor (X) has an indirect effect on the outcome (Y) through the mediator (M). I consulted the ...
1
vote
1answer
23 views

Random draw from a linear model

I'm building an individual-based model where one component includes increasing winter temperature over time (years). For each iteration of the model (say 1000 iterations that have 25 years each) I ...
2
votes
0answers
19 views

Probability of matches being random

We have a set of 576 samples that have been assayed to obtain some omics information (genomic/epigenomic). The 576 samples are mostly from unique individuals, but we have some samples for which the ...
3
votes
1answer
204 views

How does the Metropolis Algorithm “get off the ground”?

I'm thoroughly confused by the Metropolis Algorithm as defined in Casella and Berger's Statistical Inference. Namely, here's the definition (p.254): Let $Y \sim f_Y(y)$ and $V \sim f_V(v)$, where $...
2
votes
1answer
52 views

What property must a RNG have to be used in Monte Carlo simulations?

For example, every cryptographically secure pseudo-random number generator (CSPRNG) is required to satisfy the next-bit test and withstand "state compromise extensions". This makes me wonder what ...
0
votes
1answer
57 views

How to calculate number of solid color images on the screen of random pixel generator?

Is there a statistical formula/function to calculate number of basic geometric shapes on the displays of random pixel generator? Let's say we have a basic random pixel generator which has 10*10 ...
2
votes
0answers
38 views

How to find the distance confidence between the sum of random variables and a given target value?

Given a distribution $X$($E[X]$, $Var[X]$) and a target value T, I am wondering whether there is a bound on $P(|\sum_{i=1}^{i=N}X_i - T| < \epsilon)$. For example, $P(|\sum_{i=1}^{i=N}X_i - T| &...
0
votes
1answer
28 views

Permutations, shuffling WITHIN but not BETWEEN groups [closed]

In R, I need to make 100 repeat random permutations of group orders, keeping the composition and sizes of groups the same, but the order within the groups needs to be randomly shuffled (100 times) By ...
0
votes
0answers
16 views

How can I map a Gaussian vector according to an equation that has a spatial autocorrelation function?

I have the following function: $E(x,z)=30-0.5z+12.5\frac{e^{Y(x,z)}-e^{0.5}}{\sqrt{e^2-e}}$ I want to run some Monte Carlo simulations and at each simulation I have to generate values for $E$ at ...
0
votes
1answer
41 views

Statistical Reasoning of Noise Images on Random Pixel Generator

http://www.pixelmonkeys.org/#theory It is always explained that even billions of images are generated per second, it is almost impossible to see a natural image ( whether it is clear or distorted as ...
0
votes
1answer
139 views

Simulate from a mixture of two beta distribution [closed]

I have this distribution : $X \sim 0.75\mathcal{B}e(\alpha_{X_1}=1,\beta_{X_1}=3)+0.25\mathcal{B}e(\alpha_{X_2}=5,\beta_{X_2}=1.75)$ where the density function is given from this function: ...
19
votes
3answers
3k views

Finding a way to simulate random numbers for this distribution

I am trying to write a program in R that simulates pseudo random numbers from a distribution with the cumulative distribution function: $$F(x)= 1-\exp \left(-ax-\frac{b}{p+1}x^{p+1}\right), \quad x \...
2
votes
2answers
59 views

Normal distributed random variables with constraint?

Consider $n$ random variables $X_i$ with $i=1,2,...,n$, each drawing values from identical normal distributions with mean $\mu=0$ and standard deviation $\sigma=const.$ so that expectation values are $...
2
votes
0answers
33 views

How to generate samples from joint distribution of normal and logistic with R?

How to generate triple data $(Y,R,X)$ with R code satisfying following restrictions: $X \sim N(0,1)$, $R$ is binary and $P(r=1\mid y=0,x) = expit(\alpha_0+\alpha_1 x)$. $Y$ is continuous and $Y\mid r=...
1
vote
1answer
16 views

Is there a term for a random sequence of integers with every consecutive pair in the sequence being unequal?

I'm trying to generate a random sequence of integers whereby no two consecutive values are equal to each other. This sequence is meant to simulate changes in state only. Is there some term or concept ...