Questions tagged [simulation]
A vast area which includes generating results from computer models.
1,928
questions
3
votes
1
answer
71
views
How to show in R, using a simulation, that when sampling from a normal distribution, the sample mean and sample variance are independent
What is the best way to show that when sampling from a normal distribution, the sample mean and sample variance are independent?
I know the theory behind this result, I would like to show it using a ...
2
votes
1
answer
109
views
Simulate a distribution from a fitted beta-regression model for a density plot in R [duplicate]
I have produced the following figure by simulating some values from a fitted gamma regression with a low AIC value that provides the closest approximation of my raw data out of all of my models, and ...
0
votes
0
answers
41
views
Sample size in simulation and stopping criteria
I want to estimate the average of a random variable by simulation. Also, I want to estimate a proportion by simulation.
I know that there are formulas to calculate the minimum sample size so that the ...
0
votes
0
answers
31
views
Inference for Binomial proportion with estimated p but unknown N
Let's say I own a bakery that, among other desserts, sells one really tasty chocolate cake. It's so good that I've estimated that I've estimated 80% of my daily customers will buy a piece of cake, ...
1
vote
1
answer
51
views
Simulating non-zero mean autoregressive (AR(2)) samples
I asked this question in stackoverflow, with no success. I am hoping that i might get some suggestions here.
I am trying to generate non-zero mean AR(2) samples using statsmodels package. But it seems ...
0
votes
0
answers
23
views
Metropolis-Hastings on domain $(2, \infty)$
I'm trying to understand the Metropolis Hastings algorithm in depth by solving some exercise problems. On one of them, I'm asked to use MH to generate samples from
$$f(x) = c \frac{1}{\theta}e^{-\frac{...
1
vote
1
answer
64
views
Input-Output Correlations using PCA
I want to understand the correlation between a set of $\color{red}{\textrm{inputs}}$ and a set of $\color{blue}{\textrm{outputs}}$ deriving from numerical simulations, and possibly reduce dimensions ...
2
votes
1
answer
286
views
Two-component Cox proportional hazards model Simulation
In an article that I have been reading, they have a simulation study:
In this simulation, we generate $T_i$ from the following
group-specific linear transformation model: $$H(T_i) = \beta_{k,1}
X_{i,...
2
votes
0
answers
57
views
Power sizing when sampling from a group with known subgroups
I need to do a power analysis of a group that is composed of three subgroups.
The measurements to sample are difference measurements between two dogs of the same breed rated side by side. Dogs are ...
1
vote
0
answers
115
views
Tightness of rejection sampling
Hello. I'm studying the Monte Carlo Statistical Method textbook by Robert and Casella. I have a question about exercise problem 30 in Chapter 2. I've already solved parts (a)-(c), but I'm having ...
2
votes
1
answer
93
views
Is it possible to use simulated (bootstrap) A/A tests of historic data to estimate the impact of confounding factors on the treatment effect?
I recently heard a proposal for a method to measure the degree to which confounding variables impact historic results of A/B tests.
In order to ascertain the degree to which confounding has impacted ...
2
votes
0
answers
32
views
What are the steps to simulate data showing bias when missing data are MAR
I have been trying to simulate data that shows bias in the estimated regression coefficients when there is data Missing At Random. In this case I am not interested in the estimated coefficients ...
3
votes
0
answers
17
views
What are the expected residual standard deviations from each of the fitted models and data-generating process?
I simulate data to be analyzed using a linear mixed-effects model. It is based on an experiment with 2 levels (A and B) of a ...
2
votes
0
answers
55
views
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 \...
11
votes
1
answer
523
views
The probability that a Brownian bridge is a Brownian excursion
bb <- function() {
y <<- c(0,sort(runif(9999)),1)
x <<- seq(0,10000)/10000
y <<- y-x
}
plot(x,y,type="l",asp=30)
abline(h=0)
The R ...