A vast area which includes generating results from computer models.

learn more… | top users | synonyms

2
votes
0answers
15 views

Empirical confidence bands

Suppose I would like to evaluate how well, the following kernel density estimator $$\hat f (x) = \frac{1}{nh}\sum_{i=1}^nK\left(\frac{x-X_i}{h}\right)$$ works. I simulate data 1000 times and obtain ...
4
votes
1answer
24 views

Simulating a data generating process

Suppose I wanted to simulate the data generating process of a non-linear regression with ma(1) errors. So, without going into many unnecessary details, the model is $$y_t = f(x_t,x_t-1,..., x_{t_0}, ...
0
votes
0answers
15 views

Place balls in bins with specific distributions algorithm [on hold]

I've searched for an answer for my problem on the forum but is still not answered. Let's say I have N balls and want to place them in M buckets without replacement, BUT.. These buckets have all ...
1
vote
1answer
40 views

Should simulation from a student-t copula distribution yield the input correlation matrix

I am using mathematica to simulate random variates from a student-t copula distribution. Assuming that I input in the correlation matrix R, after generating a certain number of random variates, should ...
5
votes
2answers
82 views

Inverse CDF sampling for a finite mixture

The out-of-context short version Let $y$ be a random variable with CDF $$ F(\cdot) \equiv \cases{\theta & y = 0 \\ \theta + (1-\theta) \times \text{CDF}_{\text{log-normal}}(\cdot; \mu, \sigma) ...
3
votes
0answers
31 views

simulate GLM with square root link in R

I'm trying to simulate a fitted GLM using basic functions, not using the simulate() and predict() functions that are widely questioned and answered. I get different results when I compare my math ...
1
vote
0answers
10 views

estimating model fit parameters using simulations

I'm trying to fit 2D ellipticals gaussians to an image (with correlated background noise) using prewritten fitting software. I'd like to know about the uncertainty in the fit parameters with this ...
3
votes
1answer
81 views

Logistic regression simulation in order to show that intercept is biased when Y=1 is rare [duplicate]

I'm trying to simulate a logistic regression. My goal is showing that if Y=1 is rare, than the intercept is biased. In my R script I define the logistic regression ...
7
votes
2answers
181 views

What would be an example of a really simple model with an intractable likelihood?

Approximate Bayesian computation is a really cool technique for fitting basically any stochastic model, intended for models where the likelihood is intractable (say, you can sample from the model if ...
1
vote
1answer
29 views

Where should randomness come from in the Monte Carlo simulations?

Suppose that I want to check how good OLS works in some specific environment using Monte Carlo. I can simulate $Y=X\beta+\epsilon$. What should I do in Monte Carlo simulations, do I simulate the whole ...
2
votes
1answer
153 views

How many times do I have to roll a dice to get six six times in a row?

I wonder if there's any exact way to find out these two things about six-sided dice: How many throws would be necessary to get six times the same number (let's say six) in a row? What's the ...
2
votes
2answers
32 views

Generate a random chain with cauchy distribution using C language

Here is my question: I want to simulate a random variable using cauchy distribution with C language. Scale and position must be setted manually. I fuond the GSL library wich contain the function: ...
2
votes
0answers
19 views

Perturbation of binned random variables

Setup: Assume that we have an interval coded random variable $T$ which takes values in the set of half-open intervals $\{[L_1, U_1), \ldots, [L_K, U_K]\}$, where $U_k$ and $L_k$ are the upper and ...
0
votes
0answers
28 views

Calculate probability of consecutive event from R simulations

he problem is to calculate the PMF of consecutive flips of head (M) in N number of coin flips. Consecutive heads, k=0, 1, 2,...,N, the PMF is P(M=k). I use $sample(0:1,N,rep=T,prob=(0.25,0.75))$ to ...
1
vote
1answer
44 views

Calculate probability of consecutive event from R simulations

The problem is to calculate the PMF of consecutive flips of head (M) in N number of coin flips. Consecutive heads, k=0, 1, 2,...,N, the PMF is P(M=k). I use ...
1
vote
0answers
21 views

How to simulate a random variable from a matrix variate distribution?

I am trying to simulate a random variable from the matrix variate normal distribution but have not seen any literature on it. If somebody could point me in the right direction for that or if they ...
0
votes
0answers
13 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
74 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
45 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
46 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
45 views

Regression Analysis and Optimization in R

I have the following table: ...
0
votes
0answers
27 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
14 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
70 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
156 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
207 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
25 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
16 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
46 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
209 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
555 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
36 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
75 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, ...
3
votes
2answers
115 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
70 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
69 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
32 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
19 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
89 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
26 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
44 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
136 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
34 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
345 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)$$ ...