# Questions tagged [simulation]

A vast area which includes generating results from computer models.

1,587 questions
Filter by
Sorted by
Tagged with
27 views

### Conditional Distribution of the Normal Probability Distribution Function

I am trying to better understand the conditional distribution of the normal probability distribution function: https://online.stat.psu.edu/stat505/lesson/6/6.1 "Any distribution for a subset of ...
26 views

### Geometric Brownian Motion is not working, Can someone review my code? [closed]

I´m trying write a code for GBM and study how well adjust to different stocks and how far in time can work. I have defined two functions (below) and it seems that the Brownian Motion does works but ...
27 views

30 views

### Simulating data from a beta distribution [duplicate]

I want to simulate from a beta distribution which has the following properties: The mode (peak) of the distribution is closer to 0.6. The first quartile and the third quartile should be 0.3 and 0.9 ...
34 views

### Airplane problem question [closed]

I'm practicing some exercises for probability and counting and I came across this problem: A small 100 seat theatre is conducting a play, and assigns a random seat number (from 1–100) to the ticketed ...
37 views

### R: Simulating coin flips [duplicate]

Here is a problem I thought of: Suppose I am watching someone flip a fair coin. Each flip is completely independent from the previous flip. I watch this person flip 3 consecutive heads. I interrupt ...
831 views

### Flipping Coins : Probability of Sequences vs Probability of Individuals

Here is a problem I thought of: Suppose I am watching someone flip a fair coin. Each flip is completely independent from the previous flip. I watch this person flip 3 consecutive heads. I interrupt ...
23 views

### How to approach loss function based on simulation results in modern ML framework

I am trying to figure out the best way to train a NN with using a particle simulations results as the loss function. I may be simply searching the wrong terms, but it seems like most frameworks ...
19 views

### Generating samples from a n-dimensional Epanechnikov kernel

I have successfully generated samples from the 1D Epanechnikov kernel, following the routine described on page 236 in "Nonparametric Density Estimation" by Devroye and Gyorfi (Also described ...
39 views

### Distribute a fixed number of events to the days of a year following a specific distribution

I am trying to distribute a given (fixed) number of events of a year over the respective year. The empirical distribution can be modelled with a Poisson distribution because there are usually only ...
23 views

### Simulations: why is "1 by 1" much more efficient than "many by 1"?

Note: I am not familiar with discussions of this particular issue of simulation studies, so I may use wrong terms or oversee obvious aspect. My apologies for that. I want to simulate a two-step ...
25 views

### Multiple linear regression: true effect and variable specific variation

I intend to simulate a population with a single outcome variable and multiple explanatory variables, some of which do have a true effect on the outcome variable and some of which do not. The idea is ...
8 views

### Queues with non-constant arrival rates

https://cran.r-project.org/web/packages/simmer/index.html I am interested in simulating some basic queues in R. However, I want to try to simulate queues that have "non-constant" arrival ...
18 views

### Average time to win "Catch (Chase) the Ace!"

Catch (Chase) the Ace! is a popular lottery card game that is often played to win large sums of money and to donate funds to worthy charities. See: https://en.wikipedia.org/wiki/Chase_the_Ace_(lottery)...
26 views

### What are the differences between determining 'interaction' via Two-way ANOVA vs. testing against simulated expected data

In biology, we often want to test whether an observed phenotype in a mutant background of two genes A and B is significantly different from what one would expect given the phenotypes of genes A or B ...
26 views

### The inverse cumulative distribution function evaluated at Halton draws [duplicate]

Sandor and Train (2004, Quasi-random simulation of discrete choice models) mention that "A randomized Halton sequence is a set of draws from the uniform distribution. To obtain draws from density ...
21 views

### Is their a point in running a realization (simulation) for more than 1 iteration?

Let's say I have a schedule of jobs assigned on workstation, and I create a distribution for each combination of job/workstation based on historical data. I can now 'realize' the duration of one ...
25 views

### Equations for a 2D Gaussian Distribution on Grids

I'm simulating possible location data on grids which looks like the example figure below: S1 is the center that has the highest possibility of being chosen (e.g., 95%). The possibility of a cell ...
219 views

### What are relatively simple simulations that succeed with an irrational probability?

What are relatively simple simulations that succeed with an irrational probability? Let me break down this question. Relatively simple simulations. By "relatively simple" I mean simulation ...
63 views

### Testing the Central Limit Theorem with the Shapiro-Wilk test on dice rolling simulations

Rolling a single dice repeatedly will result in a uniform distribution. But if we roll multiple dice the sum would be the Normal distribution due the Central Limit Theorem (CLT). To verify this, ...
63 views

### How to interpret a n-related change in coverage for model (simulation study)

I have repeated measures data from n_subjects where each has n_obs number of measurements before and after some intervention, ...
59 views

### Can I use fits from two separate linear models to say something about a third?

Hi everyone :] first time posting here. I have a question about linear models. Suppose I have two models of the form: $y_1 = \beta_1x + error_1$ $y_2 = \beta_2x + \beta_3y_1 + error_2$ So ...
171 views

### Coverage for confidence intervals

I would like to know if my simulation approach to find the coverage for a confidence interval of a prediction $\boldsymbol{\beta}^T\boldsymbol{X}_N$ is correct I generated a dataset of $n$ samples of ...
47 views

### When to favor rejection sampling over importance sampling

I asked a question about importance vs rejection sampling: Importance sampling vs acceptance-rejection and why one would use rejection sampling when importance sampling should produce a lower variance ...
59 views

### Understanding the probability distributions behind a Monte Carlo experiment

A colleague and I are trying to model the expected maintenance cost/h (E[C/h]) of a component A on an aircraft over its life based on its reliability distribution. As the component fail, it's replaced ...
36 views

### Generating realistic mock data for a real-world scenario

Im a final year math student doing a project for a company. They want to do a cup-and-grid water drop test with a firefighting helicopter. The basic idea is: a grid of 1000cups is setup on an airfield,...
26 views

### Importance sampling vs acceptance-rejection [duplicate]

In both importance sampling as well as acceptance-rejection, we sample from some alternate distribution to simulate some expression from an original distribution of which we know the PDF. The ...
25 views

I am trying to generate a time series for $r(t)$ given the following autocorrelation function $$\langle r(0) r(\tau)\rangle = \int_{\Omega_\mathrm{min}}^{\Omega_\mathrm{max}}dz \... 1answer 65 views ### Why effect size magnitude is correlated with p value and confidence interval width in resampling statistics? I use effect size (e.g. mean difference) to compare two groups. I do randomization test to calculate the P-value and bootstrapping to find the percentile confidence interval. I notice that at a fixed ... 0answers 6 views ### Generate a misspecified covariance matrix depending on a relative error measure I am not sure if this question belongs to stackoverflow or here, but I think it is more statistics related. I want to do a simulation study where I want to investigate the robustness of a certain ... 1answer 55 views ### Significant bias introduced into simple simulation Introduction Service is allocated to an infinite source of customers i.e. there is always a service in progress. The duration of the i^{th} service is generally distributed \Delta_i \sim F_{\Delta}... 0answers 14 views ### Distribution of Geometric Brownian Motion drawdowns from realizations of multivariate Normal and Laplace distributions I am trying to simulate the distribution of Geometric Brownian Motion drawdowns from realizations of multivariate Normal and Laplace distributions under the same covariance structure. Drawdowns are ... 2answers 153 views ### A farmer is growing a magical tree This is not homework. It's a story I came up with to explain a statistical distribution I became interested in. If this is a known distribution, I'd love to be pointed in that direction. A farmer has ... 1answer 47 views ### How can I simulate a dataset with a missing not at Random situation in R? I have a dataset with two categorical variables that are missing at random, so I want to create a simulation study with missing not at random in R. I want to compare the results afterwards. 0answers 34 views ### Simulate drawing marbles from a bag with replacement time efficiently I have a bag with 256 marbles, each a different color. Everytime I run the experiment, I have a 1/16 chance of drawing any marble. I can simulate this by instead considering a bag with 16×256 marbles, ... 0answers 11 views ### Determine which independent variables are relevant by examining probability distributions? I am looking to simulate patient outcomes from a data set that contains patient data such as age, diagnosis, some clinical variables, survival time after treatment and so on. My plan was to use a ... 0answers 12 views ### simulating data to estimate clustered standard errors I've been thinking about simulating data to understand how clustered standard errors work. I thought it would be quite complicated, but then I stumbled on this World Bank blog post in which the author ... 0answers 31 views ### How to simulate a confounding variable? Suppose we have X_{true} and Y_{true} with a given correlation coefficient \rho between them. We also have a third variable W. The three variables may have any distribution you like. Now we ... 0answers 27 views ### How to forecast simulated possible futures of a time series, rather than just a deterministic forecast with prediction intervals? Time series forecasting packages typically provide the ability to see a deterministic projection of the future of the time series, often with prediction intervals. But suppose I want to show many ... 1answer 55 views ### How to understand the scaling in Metropolis Hastings MCMC We know the Metropolis Hastings (MH) in MCMC: target distribution: \pi(x) proposal distribution: p(y|x) acceptance: \alpha(x,y) = \min \Big(1, \dfrac{\pi(y)p(y|x)}{\pi(x)p(x|y)}\Big) Here are ... 0answers 19 views ### Simulating data for case-control study I am trying run a simulation-based sample size calculation for case control data. The parameters that I'm working with are: 1:1 case:control ratio 30% prevalence of exposure in controls So, the ... 0answers 16 views ### Using linear mixed models to evaluate simulation experiment results I have a simulation experiment to test different statistical models. My simulations have three factors that I have varied (A and B) and from these simulations, I've sampled some data, calibrated ... 2answers 72 views ### True mean of a truncated distribution? I use C++ GSL library to generate random numbers now. The numbers obey a distribution, (e.g. normal or lognormal distribution). This library requires the input of expected value {\mu} (i.e. mean) ... 0answers 19 views ### Proving simulation with rejection generates conditional distribution I'm working with Poisson processes, but the idea is more general. I want to simulate a two-dimensional Poisson process (over the unit square so we can ignore an area factor) with parameter \lambda, ... 0answers 28 views ### Summarise results of multiple posteriors on simulated data For a Bayesian model M(\theta_1, \theta_2) I simulated 100 datasets with fixed \theta_1 and \theta_2 and then ran posterior sampling on each dataset using model M(\theta_1, \theta_2). Now, my ... 1answer 41 views ### How to interpret this scatter plot? I am simulating a population of binary stars by generating many samples of orbital parameters. I'm investigating the relationship between the inclination of the orbit and the fraction of the ... 2answers 48 views ### How can we assess Bias when estimating step functions? I am currently conducting a simulation study in which there is a known true function F(t) which is strictly decreasing and continuous over time. I want to know if a particular estimator \hat{F}(t) ... 2answers 75 views ### How to estimate logit model I am trying to understand how to fit a logit model using maximum likelihood described in a paper:$$p_{it}=\frac{exp(\alpha+\beta q_{it})}{1+exp(\alpha+\beta q_{it})} $$where$$q_{it}=\frac{q_0d^{t-1}...
Let $\pi$ be a target probability distribution on a measurable space $(E, \mathcal{E})$. MCMC obtains dependent samples from $\pi$ by using a Markov Chain with transition kernel \$\mathrm{K}:E\times \...