A vast area which includes generating results from computer models.

learn more… | top users | synonyms

0
votes
0answers
24 views

Rejection Sampling Not Giving Correct Distribution

I hope someone can check through all my steps to see where I made a mistake: I wish to create a sample with the density $\ f(x)=\frac{1-x}{(π-2)(x + 1)√x}$ using the [1,0] uniform distribution U, and ...
0
votes
0answers
7 views

Getting started with age demographic projection

I am trying to project the future age distribution of a population within an organization using (raw) data about the current distribution, as well as past data about entries and exits per age cohort. ...
0
votes
0answers
9 views

Simulation-Large Sample Approximation [closed]

What replication size is necessary to approximate the p-value within 0.01 given no prior estimate is available?
22
votes
5answers
458 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 ...
1
vote
1answer
32 views

What do they mean by 'To calculate sample size, I use simulation in all cases.'?

I was looking for a book on sample size calculations and power analysis and I met this phrase 'I use simulation in all cases.'. What does it mean, can i forget about using traditional methods for ...
0
votes
0answers
16 views

Markov chain with quota based 'immigration'

I am trying to simulate a KPI for my work, and while markov chains were covered briefly in the courses I attended for stats, I've never actually needed to use one until now. The difficulty I have is ...
0
votes
0answers
5 views

Splitting of parameter space when using random mutation hill climbing

I have developed an agent-based model in NetLogo, and to calibrate the model and its parameters I want to use the random mutation hill climbing method. However, since my model is computationally ...
0
votes
1answer
17 views

simulate data for different sample size with same parameter

all, I'm trying to simulate data for different sample size (let say n= 10,20, and 30). At the same time, i need the parameter (in my case are skewness and kurtosis) for the data for each n is the ...
0
votes
0answers
9 views

Monty-Hall like statistics model: when a Gaussian distribution should be chosen?

I am making a simulation for a vote. This vote is special because its purpose is select 10 candidates among 100. Because a voter shouldn't vote for all of the 100 candidates (it would be too heavy), ...
0
votes
0answers
19 views

Sampling combinations

I'm running a simulation where the different inputs are combinations of $n$ values taken in $r$. The problem is that even though $n$ is small, the number of different combinations is very large, so I ...
0
votes
1answer
51 views

Bayesian GARCH(1,1) Forecasting

I am using the following bayesGARCH here package in R. I am interested in forecasting $h_t$, the model setup is given bellow. $r_t$ = $\varepsilon_t(\frac{v-2}{v}\omega_th_t)^{1/2}$ $\quad$ with ...
1
vote
1answer
37 views

What is the empirical size of a test?

Now I am doing research of a proposed test statistic. I want to calculate the empirical sizes for different sample size of the proposed test statistic under the nominal type I error,such as 0.05. ...
0
votes
0answers
16 views

Example and simulated path of strict(ly) stationary process

There are many question on stationary process but very few related to strict stationary process. I am just looking for an example and simulated path of strict stationary process and how strict ...
1
vote
0answers
19 views

NOE Model and Hammerstein-Wiener Model Similarities in System Identification

A nonlinear OE Model is defined as such: \begin{align} \hat{y} &= g(\phi(t)) \\ \phi(t) &= (u(t), u(t-1), ..., u(t-n_u), \hat{y}(t-1), ..., \hat{y}(t-n_y))^T \end{align} where $g$ can ...
0
votes
1answer
13 views

Lifetime simulation problem for late entry to the study

I was reading a dissertation where the author generates lifetimes ($T_i$) from Exponential distribution with parameter 2 (years). He sets a 5-year study period, so he simulates the censoring times ...
0
votes
1answer
30 views

Power calculation using simulation — should I use empirical distribution?

In most tutorials on power calculation using simulation (e.g. this example in R), the analyst simulates the outcome variable using some convenient distribution such as the normal distribution. It ...
3
votes
1answer
57 views

Simulate from a zero-inflated poisson distribution

I am trying to simulate from observed data that I have fit to a zero-inflated poisson regression model. I fit the data in R using zeroinfl() from the package pscl, but I am having trouble figuring out ...
4
votes
2answers
106 views

Generating Double-Triangular-distributed random variates

Wikipedia shows how to generate Triangular-distributed random variates using a variate $U$ drawn from the uniform distribution. A "Double Triangular" distribution is a special case of a mixture of ...
0
votes
0answers
26 views

Simulating dependent data by block bootstrapping

I read through some articles / forum entries concerning block bootstrapping but still don't fully understand how to prcoeed for simulating data in this way. Let's say I have multivariate timeseries ...
1
vote
0answers
60 views

Stochastic Volatility and SDEs

Consider the following SDEs $$\begin{align} &\dfrac{\text{d}S}{S}(t) = \alpha(t)\text{ d}t + \sigma(t)\text{ d}Z^{(1)}(t) \\ &\dfrac{\text{d}\sigma}{\sigma}(t) = \beta(t)\text{ d}t + ...
0
votes
1answer
22 views

Why standard normal samples multiplied by sd are samples from a normal dist with that sd

This answer notes that if a programming language/libraries provide a procedure that returns random samples from a standard normal distribution, we can generate samples from another normal distribution ...
3
votes
1answer
91 views

Forecasting Bayesian GARCH(1,1) volatilities

As a beginner in Bayesian statistics, I was wondering how one can make a GARCH(1,1) volatility point forecast using a Bayesian approach in the following model: ...
2
votes
1answer
83 views

How to compute gradient of partial log-likelihood function in Cox proportional hazards model?

The partial log-likelihood function in Cox proportional hazards is given with such formula $${}_{p}\ell(\beta) = \sum\limits_{i=1}^{K}X_i'\beta - \sum\limits_{i=1}^{K}\log\Big(\sum\limits_{l\in ...
4
votes
1answer
44 views

How to compute partial log-likelihood function in Cox proportional hazards model?

The partial log-likelihood function in Cox proportional hazards is given with such formula $${}_{p}\ell(\beta) = \sum\limits_{i=1}^{K}X_i'\beta - \sum\limits_{i=1}^{K}\log\Big(\sum\limits_{l\in ...
2
votes
1answer
47 views

Simulating a time series including a shock

I want to simulate a time series in R, following an ARMA(1,0) model in the form $Y_t = Y_{t-1} + \epsilon_t$, shocking it at time 20. In a few words, I therefore have to input $\epsilon_{20} = 30$ ...
1
vote
0answers
12 views

Simulate multinomial logistic regression model [duplicate]

I want to simulate multinomial logistic regression model i have 3 independent continuous variable. I need to simulate a dependent variable which have 5 levels with suitable beta coefficients. Please ...
3
votes
1answer
25 views

Generating random samples from a marginal distribution

I have a joint distribution $p(a,b)$ that I obtained through numerical integration- that is, I don't have a formula for $p(a,b)$ but a bunch of samples drawn from this joint distribution. I would ...
6
votes
1answer
440 views

What is the difference between Metropolis Hastings, Gibbs, Importance, and Rejection sampling?

I have been trying to learn MCMC methods and have come across Metropolis Hastings, Gibbs, Importance, and Rejection sampling. While some of these differences are obvious, i.e., how Gibbs is a special ...
3
votes
1answer
55 views

R's lm prediction interval vs simulation

I was trying to simulate the prediction interval for lm model in R, but I found out that my prediction interval is consistently biased. I've attached the code, and a sample figure below. Any idea why? ...
1
vote
2answers
33 views

Numerically finding confidence interval bounds

I am asking an R question here on the basis that statistical expertise is needed, i.e., If the language is statistically oriented (such as R, SAS, Stata, SPSS, etc.), then decide based on the ...
2
votes
1answer
39 views

Simulate a Gaussian Copula with t margins

The task is the following: Given is $Z_1,...Z_{50}$ different hypothetical assets. Each $Z_k \sim t_3$ with standard deviation $\sigma=0.01$ and $\tau(Z_i,Z_k)=0.4$ for $j\neq k$. I want to ...
0
votes
0answers
31 views

R code for multiple treatments power analysis

I tried the following code mentioned on this site- http://egap.org/content/power-analysis-simulations-r for multiple treatment power analysis in R. However, R mentions "could not find function ...
0
votes
0answers
14 views

Generating sparse data set (drug plasma concentration data) in population pharmacokinetic

How can I generate sparse PK data set (drug plasma concentration data) using the following model and parameters: One-compartment model with bolus dosing and first-order elimination as follows: ...
2
votes
1answer
149 views

How to simulate the different types of missing data

How do you create a missingness mechanism (MAR, MCAR, NMAR)? Can you generate it directly or do you do it by a model?
0
votes
0answers
58 views

Simulating data for mediation model

There is a prior question here, but it doesn't quite cover what I need. I am trying to simulate a scenario with 3 variables in a mediation setup and with measurement error. All variables must be ...
1
vote
1answer
36 views

Simulation of the cdf with copulas [duplicate]

Is this a proper way to simulate the joint cdf of normal rvs with perfect positive correlation? I followed these steps: I generate 10 000 observations for two independent uniform rvs, $U_1\sim ...
1
vote
1answer
68 views

Gibbs sampling from a complex full conditional

I have a sampling question relating to Gibbs sampling of a complicated full conditional. Supposed I have a complicated full conditional that I want a single sample from $p(\theta_i$|$\theta_{-i}$, ...
0
votes
1answer
31 views

Generating data from a specific distribution

Let X1,...,Xn be a random sample from the pdf f(x)=(1/b)exp[-(x-a)/b], a< x< infinity, 0< b< infinity, where a and b are location and scale parameter, respectively. Now I have to ...
0
votes
2answers
94 views

Calculating integral with antithetic variables

Use simulation with antithetic variables to find $$\int_{-\infty}^{\infty} \int_0^\infty\, \sin(x+y)e^{-x^2+4x-y}\,dx\,dy.$$ My question is, how struggle with the infinite limit? It is easy for me ...
1
vote
0answers
58 views

Simulating data from negative binomial model (in R)

I'm modeling after this answer in order to simulate data from a negative binomial model where both y and x are counts best described by a negative binomial distribution, and am wondering if this was ...
2
votes
1answer
57 views

How to choose a importance density for Jeffreys prior?

I want to draw Bayesian inference via importance sampling and I do not come up with a good idea of an importance density for $$p(\sigma)\sim\frac{1}{\sigma}.$$ Is there a way to sample from this ...
0
votes
0answers
14 views

Null distribution of $F$-statistic in small samples with (co-)integrated time series

A fellow economist proposed an idea for dealing with significance testing in a time series model in a small sample. I doubt its validity, but I have trouble thoroughly disproving the approach. Could ...
1
vote
0answers
19 views

Method to quantify differences between prediction and outcome for factual and simulated sample

I have vector with probability values a and binary outcome b: ...
1
vote
1answer
40 views

Determine the best sample size for minimum expected loss

Let $\theta \sim Gamma(1,2)$ and $X_1,...,X_n$ iid such that $X_i|\theta \sim Poisson(\theta)$. It is asked to determine the best sample size $n^*$ such that the posteriori risk $$L(\theta, d) = ...
0
votes
0answers
18 views

Trying to choose how much reduction to use on a variance reduction procedure

I am working with 2 simulation models on economic variables. Call these e1 and e2. The e1 simulation model was built with consideration of the e2 variable (correlated) but the e2 simulation model was ...
1
vote
1answer
58 views

How to generate correlated non-normal random variables?

I know that the Cholesky decomposition can be used to generate correlated normal random variables. Is there similar method to generate correlated random variables with non-normal distributions?
0
votes
0answers
39 views

Simulation of PDF of sum of correlated Gamma random variables (in R)

My question is very related to the general sum of Gamma RVs question found in the following link: [The sum of two independent gamma random variables There is some helpful R code there for generating ...
0
votes
0answers
11 views

How to simulate data to replicate results?

I'm want to simulate data in R like that discussed in http://arxiv.org/pdf/1412.8563v3.pdf, so I can ultimately attempt to implement their non-parametric Bayesian analysis of data from digital ...
1
vote
1answer
42 views

Combine multiple Monte-Carlo estimates

I use a Monte Carlo simulation (say 100.000 runs) to estimate parameter in R. I have memory problems and my first thought is to run multiples times my estimation program (say 500 times) . My ...
2
votes
1answer
43 views

Simulate mixture of betas

Suppose that we have $X_1, ..., X_n$ iid such that $X_i| \theta \sim Ber(\theta)$ and $\theta \sim g(\theta)$ such that $$g(\theta) = 0.6 Beta(2,1) + 0.4 Beta(1,1) = 1.2 \theta + 0.4$$ Doing the ...