Questions tagged [simulation]
A vast area which includes generating results from computer models.
1,928
questions
4
votes
1
answer
397
views
Simulate data with specified signal to noise ratio for a given sigma
Imagine I have a series $y$ that has a signal and a noise component $y=S+N$. How can I generate $y$ from $S$ and $N$ so that $y$ is 80% signal, 20% noise, and has a given standard deviation?
...
2
votes
2
answers
66
views
Adjusting sd for an ARMA(1,1) simulation given phi and theta
I'd like to generate model an ARMA(1,1) process with a mean of zero and a standard deviation of sigma where I specify the ARMA parameters phi and theta. How can I adjust the value of sigma in the draw ...
7
votes
1
answer
537
views
Understanding importance sampling in Monte Carlo integration
Introduction
I'm studying importance sampling and I'm trying to figure out by myself, with a couple of examples, what are the main benefits with respect to standard Monte Carlo integration.
I'm not ...
3
votes
0
answers
95
views
Simulating a (simple) robust mixed-effects model to calculate DHARMa residuals
I am planning to simulate a mixed-effects model fitted with robustlmm::rlmer to validate if the model is correctly specified or not by using ...
3
votes
1
answer
129
views
Gaussian noise added in social sciences data
In a simulation study (number of simulation $n=200$), there is this quadratic/parabolic function simulated with Gaussian noise added:
...
0
votes
0
answers
36
views
Generate time-to-event data from a piecewise exponential model with a binary covariate? [duplicate]
How could I generate time-to-event data from a piecewise exponential model with a binary covariate in R? Could someone point me to some R packages and/or walk through how to code this from scratch?
1
vote
3
answers
89
views
Should You Simulate the Effect of Confounders on Other Confounders to Test an Estimator?
Imagine that I am trying to simulate a data generating process where I make the following assumption about $Y$:
$Y$ = $X$(0.15) + $Z_1$(0.23) + $Z_2$(0.08) + $Z_3$(0.19) + $Z_4$(0.05) + Error
Also, ...
0
votes
0
answers
44
views
Inference of a mixture of logistic regression from simulation data in R
Here is the setup and the code that allows to simulate the mixture of 15 component of logistic regression; here each component has 5 common variables that it shares with the other component (with ...
0
votes
0
answers
119
views
How to compute Expected Squared Jump Distance (ESJD) of a Metropolis-Hastings algorithm
The Expected Squared Jump Distance (ESJD) seems to be defined slightly differently in various papers, which makes this very confusing. For instance, Definition 2.2 of Optimal Scaling of Random-Walk ...
2
votes
1
answer
58
views
Simulating Estimates with Potential Heterogenous Treatment Effects
To verify whether a given model can accurately estimate the target estimand of interest, one might generate data to simulate the assumed data generating process, define a treatment effect, and ...
0
votes
1
answer
27
views
Statistical or Machine Learning Approach for Simulating Variable (proportion)
I am currently facing a challenge in analyzing customer satisfaction data from an electric drive production facility. During a specific period of the month, we encountered technical issues with our ...
2
votes
0
answers
45
views
Can a covariate also be a random effect in glmmTMB model with ar1 [closed]
I have data consisting of catches of insects at weekly intervals over 2 years, repeated with the same methods at the same location 3 decades later. My main question is, have numbers (total and for ...
1
vote
0
answers
30
views
Expected deviation between a theoretical discrete probability distribution and the simulated one resulting from a number of trials
Suppose we have seven colors, each associated with a theoretical probability to choose one of them. The probabilities are as follows:
red ______ 0.304761904761905
blue _____ 0.304761904761905
yellow ...
4
votes
1
answer
204
views
How to sample using Gibbs with a uniform latent variable?
I trying to sample using Gibbs from a proportional distribucion $f_{Z}(z)$:
\begin{align*}
f_{Z}(z) \propto e^{-z}\left(1-e^{-z}\right)^4, \quad z >0
\end{align*}
using the joint $f_{Z,\textbf{U}...
3
votes
1
answer
574
views
Calculating minimum sample size required for repeated measures linear mixed model using the simr package
I would like to use the simr package to calculate the smallest sample size needed to achieve $0.80$ power at the $0.05$ alpha level while accounting for a small ...