Skip to main content

Questions tagged [simulation]

A vast area which includes generating results from computer models.

45 votes
2 answers
26k views

Simulation of logistic regression power analysis - designed experiments

This question is in response to an answer given by @Greg Snow in regards to a question I asked concerning power analysis with logistic regression and SAS ...
B_Miner's user avatar
  • 8,810
57 votes
2 answers
61k views

How to simulate artificial data for logistic regression?

I know I'm missing something in my understanding of logistic regression, and would really appreciate any help. As far as I understand it, the logistic regression assumes that the probability of a '1' ...
zorbar's user avatar
  • 767
72 votes
8 answers
122k views

How to simulate data that satisfy specific constraints such as having specific mean and standard deviation?

This question is motivated by my question on meta-analysis. But I imagine that it would also be useful in teaching contexts where you want to create a dataset that exactly mirrors an existing ...
Jeromy Anglim's user avatar
35 votes
3 answers
18k views

Why is it necessary to sample from the posterior distribution if we already KNOW the posterior distribution?

My understanding is that when using a Bayesian approach to estimate parameter values: The posterior distribution is the combination of the prior distribution and the likelihood distribution. We ...
Dave's user avatar
  • 2,651
23 votes
3 answers
15k views

Simulating draws from a Uniform Distribution using draws from a Normal Distribution

I recently purchased a data science interview resource in which one of the probability questions was as follows: Given draws from a normal distribution with known parameters, how can you simulate ...
wellington's user avatar
64 votes
5 answers
5k views

Why does collecting data until finding a significant result increase Type I error rate?

I was wondering exactly why collecting data until a significant result (e.g., $p \lt .05$) is obtained (i.e., p-hacking) increases the Type I error rate? I would also highly appreciate an ...
Reza's user avatar
  • 936
17 votes
1 answer
2k views

Non-uniform distribution of p-values when simulating binomial tests under the null hypothesis

I heard that under the null hypothesis the p-value distribution should be uniform. However, simulations of binomial test in MATLAB return very different-from-uniform distributions with mean larger ...
TanZor's user avatar
  • 425
21 votes
1 answer
34k views

How to simulate from a Gaussian copula?

Suppose that I have two univariate marginal distributions, say $F$ and $G$, which I can simulate from. Now, construct their joint distribution using a Gaussian copula, denoted $C(F,G;\Sigma)$. All the ...
Tilo's user avatar
  • 211
47 votes
6 answers
9k views

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 ...
AMathew's user avatar
  • 1,060
34 votes
6 answers
11k views

Generating random numbers manually

How can I manually generate a random number from a given distribution, as for instance, 10 realisations from the standard normal distribution?
A-dude's user avatar
  • 480
46 votes
9 answers
20k views

Approximate $e$ using Monte Carlo Simulation

I've been looking at Monte Carlo simulation recently, and have been using it to approximate constants such as $\pi$ (circle inside a rectangle, proportionate area). However, I'm unable to think of a ...
20 votes
2 answers
5k views

Advantages of Box-Muller over inverse CDF method for simulating Normal distribution?

In order to simulate a normal distribution from a set of uniform variables, there are several techniques: The Box-Muller algorithm, in which one samples two independent uniform variates on $(0,1)$ ...
user2350366's user avatar
12 votes
4 answers
3k views

Is this correct ? (generating a Truncated-norm-multivariate-Gaussian)

If $X\in\mathbb{R}^n,~X\sim \mathcal{N}(\underline{0},\sigma^2\mathbf{I})$ i.e., $$ f_X(x) = \frac{1}{{(2\pi\sigma^2)}^{n/2}} \exp\left(-\frac{||x||^2}{2\sigma^2}\right) $$ I want an analogous ...
Loves Probability's user avatar
9 votes
1 answer
5k views

Monte Carlo estimation of probabilities

I would appreciate some advice on how to use Monte Carlo for estimating probabilities. Generally speaking the problem I have involves running an experiment and counting the frequency of output (which ...
user23774's user avatar
  • 259
6 votes
1 answer
5k views

Simulation of KS-test with estimated parameters

We know that the original KS-test has a limitation, requiring the Null hypothesis testing underlying distribution to be fully specified, rather than estimated. But in practice, we usually need to test ...
Vincent's user avatar
  • 2,486

15 30 50 per page
1
2 3 4 5
19