A vast area which includes generating results from computer models.

learn more… | top users | synonyms

0
votes
0answers
25 views

Calculating probability of full house and royal straight in R poker simulation [migrated]

Given a poker simulation in R using vectors for the denomination and class of playing card in a loop, how would one go about identifying a given hand containing a full house or a royal straight. I'm ...
0
votes
1answer
22 views

Reducing complex simulations to analytical calculations

I wonder when can complex simulations be formulated as possibly complex but still analytical equations. I'm particularly interested in agent based models, that are frequently used in evolutionary ...
3
votes
3answers
48 views

Simulation from linear model with additional variables

I want to test the performance of a variable selection method in linear regression with normal errors using simulated data: $${\bf y}= {\bf X}{\bf \beta} + \epsilon,$$ where, as usual, ${\bf y}$ is ...
0
votes
3answers
38 views

Simulate data for 2 x 2 ANOVA with interaction

What is the best way to simulate ANOVA data for a 2 x 2 design with interaction using a regression approach? I want to generate the data so that I know the true regression coefficients of the model ...
0
votes
0answers
18 views

Simulate KM curves with assumptions in R

I am looking to simulate 2 survival curves under different assumptions on the mean / median process underlying the 2 arms. Has anyone done this in R?
2
votes
1answer
17 views

What type of simulation would be needed?

I have come up with 10 different regression models (one for every sector of the S&P500) and was interested in running a simulation as a way of testing the performance of the models. I have a few ...
2
votes
1answer
41 views

Quantiles of a compound gamma/negative binomial distribution

Are there any formulae for the quantiles of a compound gamma/negative binomial distribution? That is, suppose we have $$N \sim \text{NegBin}(\alpha, \lambda)$$ and conditional on $N$, $$Y = ...
1
vote
0answers
10 views

Using test data sets in simulation study

I'd like to know the correct way to simulate test data for a simulation study. For simplicity, suppose that I want to test a linear regression model. Chapter 7 of ESL explains that the average test ...
0
votes
0answers
6 views

Confidence regions for non-normal trivariate distributions

We are analyzing haplotype diversity within and between six populations or demes. We came up with a measure that compares the similarity of every possible pair of haplotypes within a deme or between ...
2
votes
1answer
37 views

Simulating from a normal with “unknown” variance

Suppose I want to performing sampling from a normal distribution with an unspecified variance, and I want a way to sample so that I am in some sense "averaging out the possible values of the ...
9
votes
1answer
119 views

Increased Type I error - GLM

Some of you might have read this nice paper: O’Hara RB, Kotze DJ (2010) Do not log-transform count data. Methods in Ecology and Evolution 1:118–122. klick. In my field of research (ecotoxicology) ...
1
vote
1answer
44 views

What's the correct way to simulate a division winner?

So I'm trying to simulate one winner for each of the 4 NFL divisions, assuming that all teams are of equal ability. It's clear that the probability of each team being the division winner is $1/4$. I ...
0
votes
1answer
12 views

How to simulate a binary response variable based on two non-interacting continuous variables [duplicate]

I want to simulate a binary response variable which depends on two normally distributed continuous variables, and I want to have more 1s than 0s in the response variable. I wonder how this can be done ...
0
votes
1answer
48 views

Expected Value of Random Variable

I'm trying to find the expected value of a random variable $t_i$ which is the solution of $$\epsilon_i=\mu(t_i-t_{i-1})-\sum^{i-1}_{k=1}\frac{\alpha}{\beta}\left(1-e^{-\beta(t_i-t_k)}\right)$$ ...
3
votes
0answers
79 views

Kalman Filter to correct model simulation bias

I am working with a large scale deterministic model, which attempts to simulate CO2 emissions in different regions. When compared to historic data, the model output suffers from systematic biases. ...
2
votes
1answer
31 views

Run Many Small or a Few Big Simulations to Estimate the Mean?

I was just running some simulations on tossing a coin given certain conditions, to test out some ideas I had. I was trying to find the ratio $\frac{\mathtt{successful\ tosses}}{\mathtt{total\ ...
6
votes
1answer
230 views

Generate random numbers following a distribution within an interval in R

I need to generate random numbers following Normal distribution within the interval $(a,b)$. I know the function rnorm(n,mean,sd) will generate random numbers ...
5
votes
3answers
151 views

Simulation involving conditioning on sum of random variables

I was reading this question, and thought about simulating the required quantity. The problem is as follows: If $A$ and $B$ are iid standard normal, what is $E(A^2|A+B)$? So I want to simulate ...
0
votes
0answers
22 views

Evaluating the $H_0$ of a contigency table

I have a 2 way contigency table with variables $A=\{a_1,a_2\}$ and $B=\{b_1,b_2\}$. I have the observed cell frequencies $O_1=a_1b_1$, $O_2=a_1b_2$, $O_3=a_2b_1$ and $O_4=a_2b_2$. My null hypothesis ...
2
votes
1answer
34 views

Acceptance rejection method for a binomial distribution

I have a R-code for acceptance rejection method for a beta-distribtuion but would like to use it for a binomial(30, 0.4) distribution instead. Here is the code: ...
2
votes
1answer
48 views

Simulation of KS-test with estimated parameters

We know that the original KS-test has a limitation, requiring the Null hypothesis testing underlying distribution to be fully specified, rather than estimated. But in practice, we usually need to test ...
2
votes
0answers
29 views

Generating non-normal correlated data for mediation analysis?

For a simulation study I have to generate data according to a trivariate mediation model (Baron & Kennys causal step approach). Assuming $X$, $M$, and $Y$ are continuous variables of sample size ...
1
vote
1answer
27 views

Simulating outcome of 3 political parties

First I'm sorry I couldn't figure out the most accurate title for this question (suggestions welcome). Here's the case: I want to implement spinners like the ones on this page: ...
2
votes
0answers
26 views

Monte Carlo simulation of investment account

I'm trying to estimate performance of an investment account over 20 years. The question is, have I set up the Monte Carlo simulation correctly? I've used Excel. I've assumed 8% average return and 13% ...
2
votes
2answers
305 views

How to transform a normal random variable such that I can simulate normal samples between the range of 1 and 45?

How to transform a normal random variable such that I can simulate normal samples between the range of 1 and 45? Do I need to do a jacobian transformation ?
1
vote
2answers
69 views

How can I partition a distribution into two sub-populations with fixed bias? (simulation)

I am trying to simulate a selection model for a variable $Y$ dependent on covariate vector $X$, so that two groups/sub-sets $S=(0,1)$ of observations on $Y$ are created, which have a fixed difference ...
0
votes
1answer
36 views

Simulate data by using existing dataset

I have a complete dataset with input variables and response variables. I would like to perform a simulation where I give the input variables and generate randomly the response variables. Is there a ...
2
votes
0answers
45 views

What is the best way to simulate data for a linear regression model?

I am concerned with simulating data for a linear regression model. I need to control the means, variances, and correlations (covariances) between the predictors and the criterion variable. In ...
4
votes
1answer
56 views

Hyper-volume of the $\alpha$ contour of a multivariate Gaussian

I'm looking for the assymptotic ($n\rightarrow \infty$) value of (the log of the determinant of) the covariance of the $\alpha$% of observations with smallest Eucledian distance to the origin in a ...
0
votes
1answer
21 views

State-space model with strict positive values

I've got a random process of positive observations. I've built a state space model (following an ARMA(1,3) structure), found the parameters that fit the process observations through log-likelihood ...
0
votes
0answers
62 views

How to simulate survival times using true base line hazard function

I want to simulate survival times from the model $\lambda(t|X_1,X_2) = \lambda_0(t) \exp(\gamma_1X_1+\gamma_2X_2)$ where covariates are given by $X_1\sim$Binomial(1,0.5), $X_2\sim$Uniform(0,1), the ...
3
votes
1answer
192 views

Simulate a random number of sums of random variables?

I'm trying to solve an exercise (not homework, and it does not come with solutions) that asks to provide an algorithm to simulate a probability $P(Y<y)$ and the expected value $E[Y]$ of a random ...
5
votes
1answer
76 views

Simulating Convergence in Probability to a constant

Asymptotic results cannot be proven by computer simulation, because they are statements involving the concept of infinity. But we should be able to obtain a sense that things do indeed march the way ...
1
vote
0answers
19 views

simulate ANOVA data to follow a specific eta-squared

I am simulating RM-ANOVA data with three treatment conditions (one-way within subjects designs). I would like to be able to add an effect to the data so that eta-squared has a specific value. ...
0
votes
0answers
21 views

G/G/1 Simulation help

i am a complete nooby in statistics, therefore the question i am about to ask may sound very unprofessional warning :) so, we have a task to simulate a G/G/1 queueing system for particular parameters ...
0
votes
0answers
39 views

k-fold classification or re-run experiment?

I have a classification model which is slow to run. I generate test data with 3 classes (the real data has 21 at the moment and growing), and I have run the classifier and I get a confusion matrix ...
1
vote
2answers
42 views

Match Right Skewed Distribution to Normal

I am running a simulation. One of my parameters is sampled from a normal distribution. I would like to perform a sensitivity analysis using a right skewed distribution. This is what I had hoped to ...
2
votes
0answers
55 views

Simulate censored data cox model

I would like to simulate interval-censored data in a Cox model. In the R package intcox I found the following code: ...
0
votes
1answer
36 views

How do I calculate the p-value in a gene enrichment analysis, using parametric and non-parametric methods?

I have a list of 20 QTL from an experiment involving a certain phenotype related to bone development. Of all the candidate genes within the 20 QTL intervals, 5 are associated with a certain disease ...
0
votes
1answer
58 views

Simulating Multinomial Logit Data with R

I'm looking to generate fake data to fit a multinomial logit in R? Any code/suggestions on material to look at would be very much appreciated... Thanks.
3
votes
1answer
220 views

Truncate lognormal distribution with excel

I have a dataset where I extract the mean and the standard deviation, I want to generate a new synthetic dataset which is lognormal distributed based on the original dataset paramaters. Like a ...
0
votes
0answers
12 views

How many tests do I have to run for this case?

I have developed a method to estimate a certain value called "flow" from 10% of the total data received (the total data may change every time) but of course there is an error associated with my ...
0
votes
0answers
14 views

The estimation of variance in simulation

I am confused about the calculation of variance in a regression simulation. I can get the sample of the estimator from the simulation. So there are two ways to get the variance of this estimator: one ...
0
votes
0answers
62 views

How to simulate a etas spatio-temporal model?

My question is how simulate the spatio-temporal ETAS point process (a point process used for earthquake prediction) defined by a conditional intensity function. More precisely: let $\mathbf{V}$ be a ...
1
vote
0answers
102 views

simulate multi-level data for repeated measurements

I am trying to simulate multi-level data for repeated measurements. My design includes just one within subjects factor, no between-subject factor. Consider the case of three treatment conditions with ...
2
votes
1answer
96 views

Generating Random Variables with given correlations between pairs of them:

I want to generate 2 continuous random variables Q1, Q2 (quantitative traits) and 2 binary random variables Z1, Z2 (binary traits) with given pairwise correlations between all possible pairs of them. ...
4
votes
1answer
209 views

Simulate regression data with dependent variable being non-normally distributed

For regression analysis, it is often useful to know the data generating process to check how the used method works. While it is fairly simple to do this for a simple linear regression, this is not the ...
0
votes
0answers
47 views

kalman filter: difference between simulation and forecasting

I know the question can sound trivial, but I can't get the difference between simulation and forecasting. If I've understood well, a forecast of $k$ periods ahead, starting from period $T$, is ...
2
votes
1answer
29 views

Variance regarding to the exponential of uniform distribution

If X has a uniform distribution of [0,1], and f(x) = e^X and g(x)=2^X. I generated 1000 values for X and applied to both two functions. And I calculated the variance after the transformation. The ...
3
votes
0answers
68 views

How to simulate data with values of Mardia's Kurtosis?

I have two (related) questions regarding the simulation of correlated, non-normal data with a user-specified value of Mardia’s 1970 multivariate kurtosis. (1) It is very common in my field to use ...