A vast area which includes generating results from computer models.

learn more… | top users | synonyms

1
vote
1answer
42 views

How can I generate events using the Poisson distribution in R?

How can I generate events using the Poisson distribution in R.The events can be the occurence of floods in the next 1000 years at a given rate of occurence per year
1
vote
1answer
46 views

Simulating multiple linear regression

I would like to simulate a multiple linear regression model using R. If I have the skewness and kurtosis for the residuals, how can I do that?
1
vote
1answer
46 views

Multiple Linear Regression Simulation

I'm new to the R language. I would like to know how to simulate from a multiple linear regression model that fulfills all four assumptions of the regression.
1
vote
0answers
19 views

Simulate LMM data with specific error values using R

I have a need to simulate data in R using the following: Simulate data for 5 (or more) subjects, indexed by $i$, $(i=1,~...,~5)$ with $6$ observations per subject indexed by $t$ $(t=1,~2,~...,~6)$. ...
0
votes
0answers
22 views

ANOVA for comparing methods: how to order the data

I'm going to run a series of tests for comparing different methods and combinations per two of those methods. And I was wondering how I'd best order the output so that I can easily use it in an ANOVA. ...
3
votes
1answer
42 views

How to get the quantiles by simulations?

I would like to find the quantiles of a random variable $X$ by simulations. I plan to do it in the following way, however, I do not know which one should be more correct though the results look very ...
0
votes
1answer
52 views

How to simulate a hidden Markov chain?

I want to simulate data from a 3-state hidden Markov chain with a known matrix of transition probabilities. Each state corresponds to a bivariate data with known marginals that the dependence between ...
0
votes
0answers
16 views

(Population) pharmacokinetic M&S: AUC from sparse sampling in R

I’m relatively new to (population) pharmacokinetic analyses and have a principal question with corresponding programming. I have both an already established pharmacokinetic model and a new data set ...
2
votes
1answer
57 views

Is it appropriate to use boot strapping to measure variance?

So, I always thought the idea of bootstrapping was that you have a sample from which you obtain an estimator for some function of the population (like the average height). And then when you boot strap ...
0
votes
0answers
26 views

Gillespie Stochastic Simulation in Discrete Time using R [migrated]

I'm simulating a Stochastic Simulation for Epidemiology. How do I simulate it in a discrete time? I managed to obtain for continuous time using the coding below. ...
3
votes
0answers
60 views

Bayesian analysis with histogram prior. Why draw simulations from the posterior?

This is a beginner’s question on an exercise in Jim Albert’s “Bayesian Computation with R”. Note that while this might be homework, in my case it is not, as I am learning Bayesian methods in R because ...
0
votes
1answer
42 views

Simulating responses from a factorial experiment for power analysis

I am thinking about a factorial experiment with two factors. Both factors are ordered factors. Factor 1 has two levels: small and large. Factor 2 has four levels: never, sometimes, frequently, and ...
3
votes
1answer
61 views

Compute sum of vectors drawn from multivariate normal, subject to a linear constraint

I want to compute $S = \sum_{i=1}^n x_i$ where $w^t x_i>-1, \; \forall i$ and $x_i \tilde{} \mathcal{N}(\mu, \Sigma)$ for known $w$, $\mu$ and $\Sigma$. I know $S$ can be approximated by sampling ...
4
votes
2answers
61 views

Simulate constrained normal on lower or upper bound in R

I'd like to generate random data from a constrained normal distribution using R. For example I might want to simulate a variable from a normal distribution with ...
0
votes
0answers
33 views

Closed form Karhunen-Loeve/PCA expansion for gaussian/squared-exponential covariance

The Gaussian, or squared exponential covariance is $k_{SE}(s,t) = \exp \left\{ -\frac{1}{2l} (s - t)^2 \right\}$. It is a common covariance function used in Gaussian processes. The Karhunen-Loeve ...
0
votes
0answers
12 views

Functions of Scenario-based Probability Distributions

I am considering monte carlo simulations of some probability distributions over time. For instance, I might simulate multivariate distributions $\widetilde{X}_{t+1}$ and $\widetilde{X}_{t+2}$ where ...
3
votes
1answer
146 views

Hypothesis test on data with confounding spatial clustering

This is a bit of an elaboration on a question I posted earlier, since I feel like my approach to the problem as a whole is probably quite flawed. Suppose I have a set of treatment and control cells, ...
0
votes
0answers
17 views

Distribution analysis of values obtained in repeatable simulations

I have some computer simulation after running which I'm getting a fixed-length vector of results which take values from fixed small set of sequential integers (e.g. {1,2,3,4,5,6,7,8,9,10}). I need to ...
7
votes
4answers
217 views

How can I sample from a distribution with incomputable CDF?

Semi-computer science simulation related problem here. I have a distribution where P(x) = $\frac{(e^b-1) e^{b (n-x)}}{e^{b n+b}-1}$ for some constants b and n, and x is an integer such that $0\leq ...
0
votes
1answer
52 views

Which is the null hypothesis for testing whether I've broken my simulation?

The situation: I'm writing agent-based computer simulations in which there are random effects which can be biased by various parameters. I run the simulation with the same parameters many times in ...
0
votes
1answer
57 views

Sampling from the conditional distribution assuming sampling from the joint

I am struggling with this question, which I thought it should be easy: suppose we have a method of sampling from the joint distribution of a collection of (discrete ordinal) random variables. We do ...
0
votes
0answers
43 views

Simulation for ordinal random variable utilizing multiple correlation

I need to design a simulation procedure for an ordinal variable, $Y$. I have data from a number of other ordinal variables $X_1,...,X_k$. What I want is: a) to define (or chose, I know some exist) ...
0
votes
0answers
22 views

Modeling revenues of products in many classes

I am doing product classification that classifies product descriptions into one of thousands of classes. I design a classifier that compute misclassification cost based on the product's expected ...
1
vote
0answers
10 views

Simulation of remission and after remission times under specific conditions

This is basically a data generation problem. Say, $t$ is an exponential lifetime with mean two years. $tr$ is the remission time and $ts$ is the after remission time. So, $t=tr+ts$. I need to ...
2
votes
1answer
62 views

Simulating ordinal variables using fitted probit models

I have fitted a probit model for an ordinal response and a number of predictors, using polr function in R. Now I want to use this fitted model in order to sample from the conditional distribution of ...
1
vote
1answer
66 views

Simulating data for a multiple linear regression

How can I simulate a data for multiple linear regression (one IV and more then 2 IV) when we know the skewness and kurtosis of the data? Another question is, how can we determine the type of ...
1
vote
1answer
83 views

(When) Does simulating a larger sample from a small sample yield better results?

I am trying to classify a set of $p$ predictors into 5 classes. But my sample size $n$ is rather small, so I fear I won't get a very robust estimate. Now an idea would be to subset my data for each ...
1
vote
1answer
60 views

positive skewness in simulation results

I am using simulations to make a calculation. I generate many random numbers from a distribution for each input and then I take the mean and standard deviation of the outputs. I noticed that the mean ...
2
votes
1answer
23 views

Discrepancy between calculated and simulated error propagation

Just curious if anyone knows why there is a tiny but definite difference between the standard deviation as calculated by the error propagation formula and the simulation. It is only a 0.2% difference ...
1
vote
2answers
67 views

Propagation of errors using simulation

If I construct confidence intervals for a calculation based on simulating inputs rather than using error propagation formulas, would this be considered as belonging to 'Monte Carlo' methods? I would ...
2
votes
1answer
96 views

Standard error for a statistic obtained via simulation

I am simulating the effect of certain conditions on estimates obtained using OLS regression. In running 100 replications I get 100 sets of standard errors for the regression coefficients. How do I ...
1
vote
1answer
65 views

How to simulate with given probability?

I have a presumably simple question. What does this mean: with probability 0.3 variable X is simulated as X~N(0,1). How can I simulate X using this?
1
vote
0answers
59 views

How to calculate the SE of the sum of errors in a complex simulation

I have to calculate the standard error of a peculiar situation: I am simulating a randomly generated population based on a Gaussian distribution with mean $\mu$ and std.dev $\sigma$. When the ...
2
votes
0answers
22 views

How to generate a non-normal correlated bivariate distribution [duplicate]

I am trying to work out how to generate numbers from a bivariate distribution (any one but the normal distribution) while still being able to control the correlation between the two variables (let's ...
0
votes
2answers
68 views

Simulation of Random Variables (Proof)

Given U is an uniform random variable on [0,1] and F is a cdf with inverse $F^{-1}$. I want to prove that $F^{-1}(U)$ has distribution F. Is the following proof correct: $F_{X}^{-1}(u) = x$ <=> ...
0
votes
1answer
143 views

Simulating data for logistic regression with a categorical variable

I was trying to create some test data for logistic regression and I found this post How to simulate artificial data for logistic regression? It is a nice answer but it creates only continuous ...
2
votes
1answer
93 views

Normal distribution in R

I am trying to check what is the probability that a new observation is anomalous or not? Suppose I have the following set of observations: ...
0
votes
0answers
47 views

Nonparametric time series sampling

Problem description: multiple time series for the same time period and with the same time step length Objective: stochastic simulation of one of these time series considering its serial dependency ...
1
vote
1answer
184 views

Using fitted GLM model to simulate y's from new x-values

I have a fitted GLM model: m1=glm(y~x,family=poisson,data=data). I would like to use this fitted model to simulate new data but ...
0
votes
0answers
118 views

Defining this simulation approach (Bootstrap, Monte Carlo)

I am currently carrying out simulations based on two different longitudinal (multi-state) models. In practice, these two models are aimed at parametrically estimating the transition probabilities ...
0
votes
1answer
55 views

generate IMA(1,1) series

I'd like to generate a series that follows an IMA(1,1) process, where $θ$ is the moving average parameter. I generated the series based on different representations and I got different results, I'm ...
2
votes
1answer
119 views

Bootstrapping unbalanced clustered data (non-parametric bootstrap)

I am trying to figure out how to simulate bootstrap samples from a dataset with unbalanced clusters. The approach I would like to adopt is non-parametric pairs bootstrap, which easily allows to ...
4
votes
1answer
563 views

How to simulate artificial data for logistic regression?

I know I'm missing something in my understanding of logistic regression, and would really appreciate any help. As far as I understand it, the logistic regression assumes that the probability of a '1' ...
6
votes
1answer
137 views

Replicating simulation results from a paper

I’m reading R. Kreps' paper Parameter uncertainty in (log)normal distributions and trying to figure out how the simulations were done. In order to generate Figure 1, Eqn (2.41) was used. So this is ...
5
votes
2answers
106 views

Where can I learn about transforming uniform, random distribution into other distribution

I'm caring monte-carlo simulations and I am checking my code for some faults. I have just realized (the hard way) that to generate a unit vector pointing in a random direction I cannot simply pick 3 ...
0
votes
1answer
265 views

Taking the average p value from a set of simulated p values

I have 149 locations that are lined up from east to west. I have the geographical distances between each location and the adjacent location going west. I want to test whether the locations are ...
2
votes
0answers
78 views

Simulated Microarray data

I would like to generate synthetic microarray data sets for simulation purposes. The web and literature search so far returned the following: Microarray Simulator - It provides Matlab skripts to ...
3
votes
0answers
188 views

Resampling or Basic Simulation and confidence intervals

I have a population of sales that might be won or lost. I know the rate that they are won from historical data. This case 30% of them historically win. To figure out how much money I will be making ...
0
votes
0answers
54 views

How to discretize the variance gamma process for simulating stock prices?

I want to do a stock price simulation. First of all, I used the GBM. To simulate the values, I didn't use the closed form solution for the GBM given by: $$ S_t=S_0\exp[(μ−σ^2)t+σWt] $$ but the ...
6
votes
3answers
241 views

With a small sample from a normal distribution, do you simulate using a t distribution?

I want to simulate temperature data for some "what-if" calculations. The problem is, I only have a time series of 10 actual temperature data values. I want to use temperature as an input to the ...

1 2 3 4