Questions tagged [simulation]

A vast area which includes generating results from computer models.

Using some model of a "reality", a simulator is run which generates results. A trivial example would be a computer pseudo-random number generator for the Normal distribution. More complex examples include, running simulated cars into barriers to look at their behaviour in impact and numerical weather forecasting where lots of options are run though ensemble models and the most likely is chosen.

Simulation is almost always cheaper and faster than the real thing. Sometimes simulation is the only reasonable ethical solution, e.g. when you are evaluating the safety of a device for human consumption, you can't ethically test it with humans where there is a risk of harm.

In statistics, simulation is often used to test new statistical algorithms - you simulate some data with known parameters, and then you test how well your new algorithm can identify those known parameters and compare your results against older algorithms. In real life you often do not know the true values of the actual parameters.

1906 questions
47
votes
6 answers

When to use simulations?

So this is a very simple and basic question. However, when I was in school, I paid very little attention to the whole concept of simulations in class and that's left me a little terrified of that process. Can you explain the simulation process in…
AMathew
  • 1,060
  • 1
  • 13
  • 20
12
votes
4 answers

Explanation of statistical simulation

I'm not a statistician. So, please bear with my blunders if any. Would you please explain in a simple manner how simulation is done? I know that it picks some random sample from a normal distribution and use for simulating. But, don't understand…
Curious
  • 129
6
votes
4 answers

How to set the optimal number of simulations

In geostatistical context it is common practice that for simulations of a variable of interest (e.g., grade of concentrations of metal in rock samples) the number of simulations at least needs to be 30. I would ask what the criteria is to choose a…
Developer
  • 1,444
5
votes
3 answers

How can I generate events using the Poisson distribution in R?

How can I generate events using the Poisson distribution in R? The events could be the occurrence of floods in the next 1000 years at a given rate of occurrence per year.
5
votes
2 answers

Where can I learn about transforming uniform, random distribution into other distribution

I'm caring monte-carlo simulations and I am checking my code for some faults. I have just realized (the hard way) that to generate a unit vector pointing in a random direction I cannot simply pick 3 (or any other number) random number and normalize…
Yotam
5
votes
1 answer

How to get standard error of a function (delta method vs. simulation)?

I want to get a confidence interval of a function of some parameters. for example, from the data I estimate parameters of Pareto. Now I want to get 95% CI for 90th quantile (it's a function of parameters of Pareto), so I would need standard error.…
Melon
  • 421
4
votes
1 answer

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 because it doesn't outright drop any samples. A…
ryu576
  • 2,540
3
votes
2 answers

Choosing a distribution to deal with over-dispersion

I'm working on a life insurance problem: trying to simulate the total dollar amount of claims in a year. To do this, I have a record for each person that contains their amount of insurance and an estimate of the probability that they will make a…
3
votes
0 answers

What differences and relations are between common random numbers, antithetic variates, and control variates

common random numbers, antithetic variates, and control variates are all variance deduction methods. From their Wikipedia articles, it seems to me that they are all used when estimating some quantity of two distributions, and they reduce variance…
Tim
  • 19,445
2
votes
0 answers

How to Simulate Random Times from Gambler's Ruin?

I saw this question https://stats.stackexchange.com/a/518651/403725 where the distribution of "gambler ruin times" is derived (Discrete Phase Type Distribution): $$\mathbb{P}(T=t) = w_0 \cdot \frac{(t - 1)!}{(\tfrac{t+w_0}{2})! (\tfrac{t-w_0}{2})!}…
2
votes
1 answer

How should I compare a single real world value to a group of simulated observations

I am simulating a real-world process with variation in it. I measure X, the number of calls served in time period [0,T], and I make "n" pseudo-independent observations of X. In the real-world, X was observed to be X=100, over the same time period. I…
James
  • 21
  • 1
2
votes
0 answers

Estimation of $\pi$ by generating uniformly from the unit disk

Suppose we know how to generate bivariate observations $(X,Y)$ uniformly distributed on the unit disk centered at $(0,0)$. We are allowed to generate as many observations as desired. We want to find an unbiased estimator of $\pi$. What I did is,…
2
votes
2 answers

For $Y | X$, does one need to simulate independent $X$ for every $Y$ generated or can $Y$s base on the same $X$?

If generating variables $Y | X$, then does one need to simulate independent $X$ for every $Y$ generated or is it enough to simulate $Y$s based on the same $X$? If e.g. $Y | X \sim N(x,x^2)$ and $X \sim U(-1, 1)$, then can I simulate one $X=x$ and…
mavavilj
  • 4,109
2
votes
1 answer

How to simulate head to head competition based on winning percentages?

If I have two players that are about to engage in a head to head competition, how do I simulate a winner based only on win percentage? One idea I had was to create a "weighted winning pool" where I add the two percentages and then randomly pick a…
2
votes
2 answers

Simulation of the pdf of a random variable

I want to simulate the pdf of the random variable given in the answer here: Distribution of $n\choose x$ . How can I simulation the pdf of $\binom{n}{X}$ in Matlab in way to confirm that it's indeed what the answer says?
noob
  • 639
1
2 3