A vast area which includes generating results from computer models.

learn more… | top users | synonyms

0
votes
0answers
6 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 ...
0
votes
0answers
13 views

Excel - Generate n sample with a certain level of confidence [on hold]

I was wondering if it's possible to generate n samples that will show the right average/number (or above) with a certain level of confidence. Let's imagine that I have an average of 100 and I want to ...
1
vote
0answers
19 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
0answers
7 views

ERROR: Invalid subscript or subscript out of range ONLY when I increase the number of simulation [migrated]

I highly appreciate any small advice regarding my code I receive an error message "ERROR: (execution) Invalid subscript or subscript out of range" when i run my code a certain number of simulations ...
0
votes
1answer
43 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
32 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
38 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
26 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
70 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
55 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
13 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
27 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
23 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
29 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
28 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
31 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
183 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
20 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
122 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
50 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
53 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
62 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
19 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
226 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
18 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
21 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
11 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
22 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
240 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
100 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
71 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, ...
5
votes
2answers
303 views

Simulate from a dynamic mixture of distributions

I need to sample from the following mixture of two distributions: $h_{\vec{\beta}}(r)=c(\vec{\beta})[(1-w_{m,\tau}(r))f_{\vec{\beta_{0}}}(r)+w_{m,\tau}(r)g_{\epsilon,\sigma}(r)]$ where ...
5
votes
2answers
145 views

Simulating from Kernel Density Estimate (empirical PDF)

I have a vector X of N=900 observations that are best modeled by a global bandwidth Kernel density estimator (parametric models, ...
2
votes
2answers
105 views

Nontrivially simulated distributions

I'm learning Monte-Carlo approach in sampling. There I faced with ways of how to draw samples from given distribution. But can you give me an example of a distribution which can not be trivially ...
0
votes
0answers
22 views

Label permutation with cross-validation

I wanted to find out if my machine learning application is prone to overfit. I first did an actual analysis with three diffent classifiers, and then repeated the whole process a few hundred times with ...
4
votes
0answers
33 views

What is the equivalent for cdfs of MCMC for pdfs?

In conjunction with a Cross Validated question on simulating from a specific copula, that is, a multivariate cdf $C(u_1,\ldots,u_k)$ defined on $[0,1]^k$, I started wondering about the larger picture, ...
1
vote
1answer
128 views

Multilevel logistic regression : Simulation Study

I have written R codes for simulating data from Multilevel logistic regression model . I focus on the following multilevel logistic model with one explanatory ...
1
vote
1answer
54 views

Simulating Data from Multilevel Logistic Regression

I want to simulate data from multilevel logistic regression . I focus on the following multilevel logistic model with one explanatory variable at level 1 (individual level) and one explanatory ...
1
vote
2answers
47 views

averaging after n trials of monte carlo simulation or not? which is better statistically?

related to my job I want to code a realistic monte carlo simulation for availability, reliability and related sensitivity analysis. Scenario will be complex and there will be many parameters. What I ...
2
votes
1answer
37 views

I am looking for suggestions to illustrate (e.g. visualize) the results of a statistical simulation with many conditions

Without going into the details of a statistical simulation that I am working on, I would like to ask for advice for the following problem. I am simulating the mean sqaured error (MSE) of a set ...
3
votes
1answer
103 views

Simulating non-normal correlated data for Bayesian regression

I'm interested in generating data for three separate datasets where each contains three IVs and a single DV that are correlated with one another based on meta-analytic data. For example, I would like ...
0
votes
0answers
17 views

Independence test for two small, exhaustive, categorical variables

I've got a categorical variable $var$ and a binary variable $critere$, from a pretty small (n = 300) but exhaustive dataset (i.e., the dataset contains the whole population that I want to study). I ...
1
vote
0answers
31 views

Monte-Carlo Weather Simulation

I have a trained model that predicts some interesting things (like energy usage) based on the weather (temperature, humidity, etc.). I would like to run a monte carlo on the model and get a ...
1
vote
2answers
89 views

Plotting simulated data points from f(X)+e using R [closed]

Below is a chart from An Introduction to Statistical Learning by Hastie and Tibshirani. The authors use the chart to explain overfitting. In the chart, Y is the response variable and X is the ...
5
votes
1answer
57 views
2
votes
0answers
53 views

Using simulated data to check when patterns in GLMM residual plots are acceptable

I have run the following Poisson GLMM: ...