A vast area which includes generating results from computer models.

learn more… | top users | synonyms

0
votes
1answer
15 views

replace value with condition [on hold]

I want to replace more than one values if that values satisfy a condition this is the code that I used ...
2
votes
0answers
8 views

Power calculation for multiple level clustering / randomization using simulations R

I am trying to calculate power of the following design: -Treatment is randomized over a small number of clusters (1st level clustering=regions) -Within each region we randomly select villages ...
0
votes
1answer
21 views

Optimising simulation parameters - is it possible to produce regression style diagnostics such as p values?

Let's say I have a black box simulation of some sort. It takes a couple of input parameters, and then outputs data. The output can be checked for fit against real world data. Suppose I optimize the ...
11
votes
1answer
207 views

Rare event logistic regression bias: how to simulate the underestimated p's with a minimal example?

CrossValidated has several questions on when and how to apply the rare event bias correction by King and Zeng (2001). I am looking for something different: a minimal simulation-based demonstration ...
1
vote
0answers
45 views

How to simulate this truncated normal?

I am trying to simulate data with two values: Start is a truncated normal with mean mu, sd sigma and min 0. Finish is also truncated normal. But X% are half or less of start. How can I simulate ...
0
votes
0answers
52 views

How find controls limits for CUSUM chart

I am trying to re-do a simulation work in quality control. In this simulation they use bisection search algorithm to find the control limits h (the threshold) that gives the desire average run length ...
2
votes
0answers
20 views

Miss Forest & Iterative PCA : How to handle very sparse matrix imputation?

I am currently benchmarking matrix completion methods (k-NN, RandomForest and iterative PCA) on multivariate normal data in which I introduce a certain proportion of NA (5 to 95%). My performance ...
0
votes
1answer
18 views

Generating sample proportions when the true proportion is close to 1

Suppose the true proportion of success is $\pi$. I would like to generate sample proportions around $\pi$. I can use ...
1
vote
0answers
21 views

understanding and reporting results from monte-carlo simulation

I apologize upfront if the the question is vague. Basically I have results from monte carlo simulation and I'm trying to understand how to present the results and importantly the "why" part of the ...
0
votes
0answers
4 views

Multiplying odds by a Pareto RV - has this been done?

I have an agent-based/microsimulation epidemiology model. There is an individual-based parameter, which I would like to increase by a varying amount for each individual. The parameter $p \in (0,1)$ ...
0
votes
0answers
12 views

Simulate data from a custom density function with rejection sampling

I'm trying to find a solution for this problem. I want to simulate in R data from a distribution generated by a CDF like this $$F(x) = c\tfrac{\log^3(x)}{x^2}$$ or equivalently, in this case, from ...
0
votes
1answer
21 views

Poisson process to determine request arrival times in LTE network

I need some help with this problem. A Poisson process is generally used to describe the arrival of calls in a mobile network. Since I am developing a simulator for LTE, i need to implement such a ...
2
votes
1answer
28 views

Can Metropolis be considered as evolutionary algorithm?

If we compare simple 1+1 evolutionary algorithm (e.g. Droste, Jansen, and Wegener, 2002) 1+1 evolutionary algorithm Set $p_m := 1/n$. Choose randomly an initial bit string $x \in ...
1
vote
2answers
45 views

Number of samples needed in Monte Carlo simulation: how good is this approximation?

In Risk Theory Beard, Pentikanen and Pesonen (1969) mention a method of assessing number of samples needed for Monte Carlo simulation as $$ \sigma = \sqrt{\frac{p(1-p)}{s}} \leq \frac{1}{2} \sqrt{ ...
4
votes
1answer
52 views

Testing for normality in non-normal distributions with zero skewness and zero excess kurtosis

[This question was formerly called "On Non-normal distributions with zero skewness and zero excess kurtosis" and relabeled to better reflect its focus.] I am trying to write a little simulation using ...
2
votes
1answer
21 views

Characterizing the distribution of manufacturing data

I have some data from manufacturing concerning the variability of certain geometric dimensions of a given machine. These are real numbers (diameters, angles, lengths, etc.), so the variables are ...
1
vote
0answers
15 views

Multiple test correction procedures for multiple regression with dependent predictors

A researcher is employing OLS multiple regression to examine the independent effects (i.e., partial correlations) of a moderate (~8) number of theoretically-relevant predictors on some outcome. The ...
0
votes
1answer
47 views

Simulate data around existing data in r

I have been working at this for sometime, surfing StackExchange and any other R webpage I can find without any luck. I am trying to simulate data to essentially recreate the attached figure with ...
1
vote
0answers
26 views

Sequential conditional simulation to avoid using a large covariance matrix

I would like to generate $S$ samples of a $T \cdot M$ dimensional vector, where $T$ is the number of time steps and $M$ the number of locations, i.e., the vector is a stack with $T$ values for ...
0
votes
1answer
49 views

Stopping time distribution of a fun and simple game!

A friend of mine asked the following question, which I haven't found a convincing answer for it yet. I'd appreciate any comment in advance. The game has two players $A$ and $B$, each having $\$5$ ...
0
votes
0answers
21 views

Type one right censored data [duplicate]

Does anyone have any idea about how to simulate censored data in R? For example, generate a sample of 200 with 30% of that Type 1 right censored, based on Weibull distribution. (30% of 200 = 60).
1
vote
1answer
43 views

Estimating population variance through simulation in R

I want to estimate the variance of the exponential distribution with a rate of $\lambda=0.2$. I'm drawing a sample of 5 exponentials 1000 times, and know that the theoretical variance of my ...
0
votes
1answer
41 views

Simulation of Poisson data with a endogenous regressor

My simulation setup goes like this: I draw my dependend variable as $Y\sim \text{Poi}\left(\lambda\right)$ where $\lambda = \exp\left(\beta_0 + \beta_1x_1 + \beta_2z + u\right)$ and $z = \gamma_0 ...
0
votes
0answers
30 views

Simulation of logistic regression power analysis - output given

This question is in response to an answer given by @gung in regards to this question I am also wanting to use simulation to conduct a power analysis on a multiple logistic regression. To keep it ...
4
votes
2answers
80 views

How to simulate a random slope model

I would like do create a mixed linear model for an unbalanced dataset (different number of events per subject and a few missing values for some time points). I am using ...
0
votes
0answers
65 views

How to simulate informative censoring in a Cox PH model?

I wish to simulate events from a Cox PH model where the censoring is informative, and to compare parameter estimator quality with estimates obtained from data generated by a Cox PH model with ...
0
votes
0answers
9 views

Calculate mean and std dev from experiment - no formal params

I am a little lost on how to calculate mean and std dev from an experiment (simulation). I have run the simulation (10000 times) and it output a set of numbers (10000). Plotting a histogram, it gives ...
0
votes
0answers
14 views

Evaluation of the semi-closed Heston pricing formula for call options

I'd like to know, how the integral part of the semi-closed Heston pricing formula for call options can be simulated for a given set of model parameters. Monte Carlo simulations shoud work for this ...
0
votes
0answers
15 views

Explanation of mcstoc from empircal distribution in mc2d

I'm using the mc2d package to simulate from a cost distribution. I have lots of data so rather than fit a weibull or some such, I want to just estimate from the empirical. Below I show you the data ...
0
votes
0answers
30 views

Comparing raw non-normal data with a mean and SD of non-normal data

I have raw data, which are non-normally distributed (negative binomial, or if converted to densities, compound Gamma-Poisson), as well as a mean and standard deviation (SD) of another data set ...
0
votes
1answer
24 views

Confirming calculations with simulations?

This question may be a little abstract, but I would like to understand how to develop a mentality towards performing statistical simulations. For example: If I have a normal distribution, and I ...
0
votes
1answer
32 views

Correlation coefficients of a time series

I have 100 simulations of an ARMA(1,2) process, created with R is such a way: ...
0
votes
1answer
41 views

Simulation of time series with R [closed]

I'm new on time series. I'm trying to solve an exercise on the simulation of an ARMA process. The problem is the following: Generate 100 simulations, each with n=60 elements of an ARMA(1,2) process ...
2
votes
1answer
35 views

Which distribution is correct in modeling conversion rate in a Monte Carlo

I am building a model for a Monte Carlo simulation that estimates the number of sales made for a door-to-door salesman. Looking at his historic success by city, it seems he converts about 80% +/- 20% ...
5
votes
2answers
217 views

How to simulate censored data

I'm wondering how can I simulate a sample of n Weibull distribution lifetimes that include Type I right-censored observations. For instance lets have the n = 3, shape = 3, scale = 1 and the censoring ...
0
votes
0answers
24 views

ARIMA Simulation in R does not model data well

I have a time series that I wish to model with an ARIMA model in R. I computed the ARIMA model like so: arimaModel = arima(data, order = c(5,0,1)) When plotting ...
5
votes
1answer
133 views

Simulate a random variable having piecewise gamma failure rate

I am having trouble in simulating values for a random variable $X$ having a piecewise gamma failure rate: $$ \lambda_X(t) =\lambda_1(t)1\!\!1_{\lbrace t\leq t_0 \rbrace} + \lambda_2(t)1\!\!1_{\lbrace ...
1
vote
0answers
51 views

How to combine normal distributions to have a mixture with specified kurtosis

I want to generate random samples from Normal Distributions $N(\mu_i,\sigma_i)$ by fixing kurtosis parameters ($\beta$s), as I need to simulate data by varying $\beta$ for my problem. I am trying to ...
2
votes
1answer
59 views

Simulating random variables given partial distributions and correlation

After Monte Carlo simulations I obtained approximated distributions for X and Y. Now I want to add some form of correlation between them. To simulate random variables from a distribution the idea is ...
3
votes
1answer
68 views

Use of Poisson distribution to analyse distribution of individuals in space

Dytham 2010 suggests using the Poisson distribution to establish whether individuals are evenly distributed in space. Say we end up with a map of individuals in a study site that looks like the ...
0
votes
0answers
25 views

Why are my random effects averaging out to zero in my Monte Carlo Simulation?

I'm using SAS to conduct a Monte Carlo simulation for a linear mixed model of the form y = Bx + Zu + e, where B and Z are design matrices for the fixed and random effects, x and u, respectively and e ...
9
votes
4answers
247 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 ...
2
votes
0answers
22 views

Application of Permutation Tests

I don't know how to post the question more formally. Therefore, let me introduce an example. Suppose you want to estimate the following regression: $n_i = f(x_i)+\beta \cdot 1[x_i = j]$, $n_i$ is ...
0
votes
0answers
23 views

How can I form an SDE with two Levy noises using the YUIMA package in R?

I'm trying to use the YUIMA package in R to simulate a two-dimensional process with two distinct Levy noises, but I can't seem to get it to work. I've searched online for documentation or examples ...
0
votes
0answers
17 views

Computing standard errors in EM using Louis method

Can someone assist on how to use the Louis method to calculate standard errors, i already have the code for for E- and M-steps.
0
votes
0answers
27 views

Predict Kaplan-Meier Curve from Hazard Ratios

For illustration purposes I want to plot some potential hazard ratios, based on a known proportional hazard model. For example, plot the known curve, then plot what the curve may look like with HR's ...
6
votes
1answer
254 views

Estimating Multilevel Logistic Regression Models

The following multilevel logistic model with one explanatory variable at level 1 (individual level) and one explanatory variable at level 2 (group level) : ...
1
vote
1answer
113 views

Generate three pairwise correlated random variables

I need to simulate three variables $A,B,P$ ~ $N(0,1)$ such that the Pearson correlations $r_{AB}=\operatorname{cor} (A,B)$ and $r_{BP}=\operatorname{cor}(B,P)$ are given. I need to repeat the ...
1
vote
0answers
86 views

Simulate from a dynamic mixture of distributions, honoring the tail

This question is a follow-up to this other question, brilliantly answered by Xi'an. I have a dynamic mixture of Weibull and GPD distributions (with a CDF Cauchy mixing function). The mixture is ...
0
votes
0answers
4 views

Rate of occurrence for a schedule

I'm currently doing a research of a classroom usage simulation. And I shall do something with a schedule which I should calculate the rate of classroom begin in a particular office hour. Let's say, ...