A vast area which includes generating results from computer models.

learn more… | top users | synonyms

14
votes
6answers
847 views

When to use simulations?

So this is a very simple and stupid question. However, when I was in school, I paid very little attention to the whole concept of simulations in class and that's left me a little terrified of that ...
0
votes
0answers
7 views

Interpreting and simulating reciprocal relationships in path analysis

I'm trying to model how the process of habitat clearance affects the number of species in a landscape, using path analysis. I have the following variables: ...
2
votes
0answers
33 views

Copulas for generating uniform random variables with correlations

I want to generate uniform random variables which have a correlation structure defined by a graph i.e. a variable is only correlated with its neighbors in the graph and is uncorrelated with the rest ...
1
vote
0answers
17 views

Intraclass correlation and simulating data

I will apologize in advance for this somewhat messy problem. I am trying to take an ICC reported from a previously published manuscript and design a general simulation program. Let's say the ...
1
vote
1answer
24 views

simulating a multiple comparisons problem using R and bonferroni correction

I am actually working on an exercise for my students dealing with multiple comparisons. However, I was having trouble trying to simulate some data in R to demonstrate the problem with multiple ...
0
votes
0answers
26 views

Deforestation Scenarios using Logistic Regression (Stata)

I used Logistic Regression to model the contribution of a range of explanatory variables on deforestation processes (being my dependant variable - Deforested=1, No Deforestation=0) in the Brazilian ...
1
vote
0answers
38 views

How to present multiple distributions with R?

I have a stochastic simulation on NetLogo in which my agents accumulate "wealth". Of course, every run gives me different outputs but with pretty much the same distribution. I use histograms to keep ...
0
votes
0answers
4 views

simulating AR(1) process for N variables in MATLAB [migrated]

I am quite new in programming, can somebody tell whether the following approach is correct in matlab? clc; clear; N = 15; T = 221; alpha = randn(N,1); % normally distributed intercept as ...
1
vote
1answer
14 views

Difference between recentred and scaled eigenvalues and the Tracy Widom distribution

I have been generating correlation matrices from independent normal data simulated using the MASS package. I do this k times and extract the eigenvalues of the matrices. I was interested in comparing ...
5
votes
2answers
131 views

How to simulate effectiveness of treatment in R?

Let's say I want to write a simulation for the table below to decide if Xylitol treatment and ear infections are independent. How would I go about doing this?
0
votes
0answers
32 views

MonteCarlo simulations to test light curve variability

I have an average orbital light curve for a source, that is, binned count rate vs orbital phase, where the count rate are averaged over a number of orbit. I want to run MonteCarlo simulations to find ...
1
vote
0answers
23 views

A simple approach to maximum likelihood estimation for a model with no closed-form solution

I would like to estimate the best fitting parameters of a parametric model, $f(\theta)$, that does not have a closed-form solution. There are $n$ i.i.d. environmental observations and the aim is to ...
2
votes
1answer
110 views

How to simulate a system where “the failure probability per week is 3.5%”?

I have system described by a statement like "The failure probability per week at 20 Celsius degree is 3.5%", how can I simulate such a system? The simulation I have in mind should answer to questions ...
0
votes
1answer
34 views

Generating random simulations of events [closed]

Whole-edited to make it more simple. Let's assume we have a concrete event: A baseball player's batting average is 0.32. I want to find a random number X, that ...
2
votes
1answer
160 views

Why is the difference between these two t-tests so big?

I am using a t-test to find out whether the mean of a sample ($1.05$) with a sample size of $100$ is significantly different from a given mean ($1.2$). The standard deviation should be $0.5$: ...
1
vote
1answer
28 views

Simulating r.v.'s $X, Y, X \in [0,1]: X+Y+Z = 1\;a.s.$ given we know $E[X],E[Y],E[Z]$ and $E[X]+E[Y]+E[Z]=1$ with marginal variances $\sigma^2$

I think my title says most of my question, but let me re-state: I am trying to simulate variable percentages (i.e., X,Y,Z) on the above simplex without using the Dirichlet distribution. The reason ...
1
vote
0answers
19 views

Distribution of “priority” emails among agents with different speeds (strange question)

but I figure if someone knows how to answer it, it may be someone here. Basically I have this weird distribution where the customer service agent speed (in terms of contacts per hour) is very ...
5
votes
1answer
124 views

A potential confound in an experiment design

Overview of the question Warning: This question requires a lot of set-up. Please bear with me. A colleague of mine and I are working on an experiment design. The design must work around a large ...
1
vote
1answer
35 views

Simulating Negative Binomial Arrivals

I am building a simulation. I want to generate arrivals according to a negative binomial process. The data will show the minute of each "customer" arrival and look something like the following: ...
0
votes
0answers
12 views

Conjoint simulation output

I am doing a traditional conjoint study with 3 attributes (brand,price and applicator) each with three levels. I asked respondents to rate the profiles from 1 to 9. Now I run 2 simulations with 9 ...
0
votes
0answers
14 views

ABC-based inference for a dynamic model of multiple time stages

I am working on a dynamic model of multiple time stages (e.g. 0-15h, 15-30h, 30-45h); the model has three time stages in total. Each stage has associated with it 4-8 different parameters and I am ...
1
vote
2answers
32 views

Relative Error Temperature

I have a model to simulate temperatures and I want to compare it to reference values. I thought that the relative error (or rather percentage error) would be interesting, but I'm rather confused on ...
0
votes
0answers
56 views

Generate correlated continuous and categorical data in R

Task at hand: generate a simulated dataset containing both continuous and categorical variables, given a pre-defined correlation matrix. What has been done: this post covers how to generate ...
4
votes
1answer
31 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}, ...
1
vote
1answer
61 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 ...
7
votes
2answers
105 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) ...
4
votes
1answer
48 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
14 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
101 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 ...
8
votes
2answers
206 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
38 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
180 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
41 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
24 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
38 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
55 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
25 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
19 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
88 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
55 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
50 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
29 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
50 views

Regression Analysis and Optimization in R

I have the following table: ...
3
votes
0answers
53 views

Skew of p-value distribution under composite null hypotheses

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
19 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
76 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
174 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
212 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 ...