Tagged Questions

A vast area which includes generating results from computer models.

learn more… | top users | synonyms

0
votes
0answers
8 views

How could I calculate value at risk by simulation from garch model?

I need to calculate value at risk for return of mutual fund by using simulation monte carlo for model garch ...my data have 139 observations and its not normally distribution ...what are the steps to ...
0
votes
0answers
5 views

Optimizing grid of sources and multipliers

I have a 35x35 grid of cells. There are two possible states for cells: "source" and a "multiplier". The center 25x25 cells may be either "source" or "multiplier". The rest of the cells must be ...
2
votes
0answers
52 views

Simulation of Monte Carlo test

Using R, I am trying to simulate how the power of a Monte Carlo two-sample test for central tendency changes with sample size. However, my simulation results does not show power increasing with sample ...
2
votes
1answer
36 views

Dice rolls, simulation vs. theory

I just ran into something interesting, and was hoping someone could shed some light on it. I'm trying to calculate rolling at least N on multiple dice. I wrote a simulation script in R that uses the ...
2
votes
1answer
41 views

Inconsistency between sample median and theoretical median for skewed normal using rsnorm in fGarch

I am using the rsnorm function within the R fGarch package to generate random samples from a skewed normal distribution. ...
1
vote
0answers
25 views

How to simulate from a standard normal random variable

Up until now, I have always used the rnorm command in R, to simulate from a standard normal distribution. I've always wondered though, how does this command work? ...
0
votes
0answers
43 views

Regression Analysis and Optimization in R

I have the following table: ...
1
vote
0answers
17 views

Putting generated data in a matrix format [migrated]

I have one question about putting a simulated data in a matrix format, but I cannot suitably write its program in R, and constantly receive an error, I guess my "rep" definition and final "Matrix" ...
0
votes
0answers
19 views

P value distribution skew & hypothesis testing

On this page it says ...if HA holds, the p-values have a distribution for which values near 0 are more likely than values near 1. However the p-values may have a distribution that is not ...
0
votes
0answers
10 views

Simulation of CI of amount of values in different intervals by adding noise to original data

I am having a hard time trying to solve this problem, so maybe some of you guys can sort it out. I have a large data set containing a value describing the thermal comfort in buildings called PMV. The ...
0
votes
1answer
66 views

Bootstrapping probability of success: what is wrong with my method?

I have a dataset where each row represents the outcome of individual bets placed by a population of players; each row has two fields: a player identifier and the outcome of the bet (1 if the player ...
0
votes
0answers
16 views

Getting estimates of hospital specific stroke admissions data

I am analysing a small data set on stroke process of care gathered from public sources but don't have access to hospital specific emergency stroke admissions over a period of time data except for ...
8
votes
1answer
141 views

Low sample size: LR vs F - test

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. Currently I am comparing negative binomial ...
4
votes
1answer
197 views

How to interpret variables that are excluded from or included in the lasso model?

I got from other posts that one cannot attribute 'importance' or 'significance' to predictor variables that enter a lasso model because calculating those variables' p-values or standard deviations is ...
0
votes
0answers
24 views

Have a data set for 3 consecutive days. What are my options?

Let's say I have a set regarding the transportation methods(Eg: car, bus, train) used for three consecutive days b y $n$ number of people. For simplicity let us assume that everyone use only one type ...
0
votes
0answers
14 views

How to check the convergence of a binary simulation process?

I conducted a simulation study using like Gibbs sampling by which a $1000 \times 10000$ binary data set was generated. Now I would check the convergence of this simulation process. Suppose the output ...
0
votes
1answer
40 views

Goodness of fit: observed vs simulated data

I have a set of 2-dimensional "observed" data of sample size N: $$O = \{(x_1, y_1), (x_2, y_2), ..., (x_N, y_N)\}$$ The hypothesis is that $O$ is a realization of ...
3
votes
2answers
203 views

What are the advantages of a simulation over an exact binomial calculation?

Let's say that I want to calculate the probability of achieving more than 8 heads in 10 coin tosses. The easiest and most accurate way will be to simply use the binomial distribution and sum the ...
9
votes
2answers
465 views

Simulating draws from a Uniform Distribution using draws from a Normal Distribution

I recently purchased a data science interview resource in which one of the probability questions was as follows: Given draws from a normal distribution with known parameters, how can you simulate ...
0
votes
2answers
34 views

Simulating violations of regression assumptions

I'm wondering if anyone could provide some code (preferably in R) which demonstrates violated assumptions leading to type 1 errors. Some concrete examples of errors arising from assumption violations ...
0
votes
1answer
61 views

Simulate time to event times based on an existing subset of data

I have to task to predict data volume to be processed for a study that currently has 40 patients, but will have 100 patients eventually. Since most of the data is generated during the treatment phase, ...
2
votes
1answer
83 views

Generate random data for logistic regression with a categorical independent variable

I am trying to generate a data frame of fake data for exploratory purposes. Specifically, I am trying to produce data with a binary dependent variable (say, failure/success), and a categorical ...
0
votes
1answer
27 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
65 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
54 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
27 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
18 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
71 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
17 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
9 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
42 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
129 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
45 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
21 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
318 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
104 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
34 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
295 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 ...
6
votes
3answers
186 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 ...
1
vote
0answers
27 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
81 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
102 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
50 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
32 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
34 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
317 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
72 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
39 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
59 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
66 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 ...