Questions tagged [simulation]

A vast area which includes generating results from computer models.

Filter by
Sorted by
Tagged with
4
votes
1answer
99 views

Simulating observations for a 2-way ANOVA (in R) w/ mixed effects model and recovering true variance parameters [Gage R&R]

I would like to create a simulation of a Gage R&R experiment in R. A Gage R&R is an experiment designed to analyze the variance contribution of several factors relative to the overall variance....
0
votes
0answers
21 views

Constrains on the coefficients of SARIMA

I am trying to generate synthetic time-series through SARIMA random process by defining the model coefficients manually. Could any one help me how to generate coefficients? What are the constraints on ...
3
votes
1answer
152 views

Holding other predictors constant via simulation in R

Imagine predicting salary of some professors from their years of experience (time) controlling for/holding constant their number ...
0
votes
0answers
17 views

Comparing simulated parameters to their theoretical values

I created three variables in r using this code ...
3
votes
1answer
52 views

How to compare correlation coeffecients across studies (meta-analysis, simulation-analysis)?

I have one metric dependent variable (grain yield) and three metric traits, A, B and C. Grain yield and all three traits were measured in several studies and each time a Pearson correlation between ...
0
votes
0answers
29 views

Cross comparison analysis of simulation models

For my thesis, I created a simulation model which simulates the barge shipping process (basically travelling to the port and do a route where terminals are visited so that barges will be handled). I ...
2
votes
3answers
36 views

What would be the probability distribution to simulate K events randomly assigned to N individuals?

I am trying to randomly simulate a population of $N$ individuals among which a predefined number $K$ of them have an outcome. The trick is that I want to assign different probabilities to the ...
0
votes
0answers
4 views

How to find the best or optimal parameter value set for agent based or other kind of modeling?

I am doing agent based modeling (ABM) for infectious disease modeling, and the model has 50+ parameters which can any probability value between 0 and 1, or can be any float value from 0 to >0 (...
1
vote
0answers
24 views

Clustering common words for objects

I am currently running experiments aiming to simulate information transfer between agents. Without going into too much irrelevant detail, following the conclusion of a simulation I am left with a csv ...
5
votes
1answer
61 views

sampling from $\frac{1}{1+x}$ times Gamma distribution density

I am simulating a process by drawing many random variates $X$ from a Gamma distribution with parameters $\alpha$, $\beta$, $$f_X(x) = \frac{\beta^\alpha \, x^{\alpha-1} \, e^{-\beta x}}{\Gamma(\alpha)}...
5
votes
2answers
74 views

Generating uniform points inside an $m$-dimensional ball [duplicate]

The present question follows on from some other questions on this site asking how to generate uniform points inside a disc (see e.g., here, here and here). The natural extension of that problem is to ...
1
vote
2answers
21 views

Simulation study - what error variances to use from empirical data? MS error of an ANOVA or the variance of their residuals?

I want to do a simulation study in R and I have already some empirical data, that gives me a hint about the variance parameters to set. But what should I use for the error variance? Here's an example ...
16
votes
3answers
1k views

Generating random points uniformly on a disk [duplicate]

I have to randomly generate 1000 points over a unit disk such that are uniformly distributed on this disk. Now, for that, I select a radius $r$ and angular orientation $\alpha$ such that the radius $r$...
6
votes
1answer
118 views

Why is the coverage of this lme4 confidence interval less than 95%?

I have data that can be described using the model $y_{i j} = \alpha_i + \epsilon_{i j}$, where $\alpha_i \sim \text{N}(\mu_{\alpha}, \sigma_{\alpha}^2)$ and $\epsilon_{i j} \sim \text{N}(0, \sigma_{\...
0
votes
2answers
17 views

Does generating data from a normal with an effect added and comparing to a standard normal allow for calculation of power?

I generated 100 random variables from a normal with mean 1 and standard deviation 1, representing a large effect size when compared to a standard normal. Using a test where I compare p values from the ...
1
vote
0answers
67 views

Power calculations for a mixed model using simr

I'm trying to conduct a power calculation for a mixed effect model I built using lmer. I already have some pilot data, so I have an idea of the estimated effect size, but what I'd like to know is what ...
0
votes
0answers
26 views

Adding Positive Skew to a Simulated Data Set

I have created code to simulate normally distributed data based on loadings from a bifactor model (Caspi et al., 2014). I need to add a skew of 2.0 to each variable in the data set to simulate the ...
1
vote
0answers
35 views

Simulating data for logistic regression with unbalanced classes

I want to simulate categorical data for logistic regression, and those data need to have unbalanced class representation. Simulating for logistic regression with (nearly) balanced classes is simple ...
2
votes
1answer
69 views

Why isn't simulation showing that ridge regression better than linear model

I am learning about ridge regression. I was under the impression that ridge regression is valuable because it provides better out of sample predictive accuracy than standard linear models. For example,...
2
votes
1answer
34 views

Normalizing posterior distribution

This is from task 5.3. in Bayesian Data Analysis 3rd edition by Gelman et al. It deals with a hierarchical model where I am supposed to simulate the posterior distribution for $\tau$, which is the ...
1
vote
0answers
27 views

Simulate a variable based on a known correlation and distribution

I have a normally distributed variable (var2) with a mean of 10 and sd of 3: mean <- 10 sd <- 3 var2 <- rnorm(n = 1000, mean = mean, sd = sd) I want ...
1
vote
0answers
55 views

Circular variance of a mixture of Von Mises distributions

Does anyone know if there is an analytical solution for the (circular) variance of a mixture of Von Mises distributions that all have equal (circular) mean? Simulation results suggest that the ...
2
votes
0answers
29 views

simulation of logistic regression sensitivity to prior probability: Brier score vs accuracy

I wrote a simulation in R that compares performance of a logistic regression as I vary the prior probability of the two classes. The gist is that I do a simulation of data that generates nearly ...
4
votes
1answer
35 views

Generating values from Normal Mixture distributions via copulas

I have some values with unknown joint distribution, but I am assuming that the marginal distributions are two-part Normal Mixtures. I am modelling the dependency between the distributions via vine-...
0
votes
0answers
30 views

What is the estimated distribution obtained in the parametric bootstrap called?

Let a statistical model $p(x\,|\,\theta)$ be given, and let $\bar x$ be data obtained from a process represented by that model. Let $\hat\theta(\bar x)$ be an estimate of the parameter $\theta$ by a ...
1
vote
0answers
25 views

Number of MC Simulations in Multivariate Model with Copulas

I am working on a project with the following characteristics: 4,000 hydroelectricity generation time series 800 futures time series (each corresponding to at least one hydroelectricity time series) ...
1
vote
1answer
28 views

Bug in evaluating the velocity autocorrelation function

I am running a molecular dynamics simulation (with a Lennard-Jones fluid), and I want to evaluate the velocity autocorrelation function for my simulation. I am running a simulation with $N$ particles, ...
0
votes
0answers
14 views

SImulating waiting times in simmer

I am trying to simulate the waiting times of barges and deep-sea vessels in a port. My goal is to reduce the waiting times. In the code below I am trying to scale up the service of barges while the ...
0
votes
0answers
10 views

How can I build a simulation environment that assess different risk policies?

I work in fin-tech and would like to build some sort of simulation program to assess how different inputs will impact net revenue. For example, if we create new policies based on ML scores, how would ...
2
votes
1answer
46 views

Why Some Simulation Scenarios Don't Look Real? [closed]

I have been using Monte Carlo simulation to evaluate A/B testing algorithms for quite a while. I noticed some simulation cases produced by simulation are never seen in real data. For example, the ...
0
votes
0answers
14 views

How does pymc3 posterior simulation work in this simple case without having the full conditional distributions?

I'm trying to estimate the posterior distribution of the gamma parameters alpha and beta given that my data comes from a gamma distribution and the priors I chose come from two uniform distributions. ...
0
votes
0answers
16 views

Model discrete event simulation for cancer natural hostory

I am designing a programme in R to simulate two events that are 1. person get cancer or 2. die of other causes. I have data for the probability of getting cancer by age and probability of death due to ...
0
votes
1answer
41 views

Forecast confidence intervals from multiple realizations

I have a forecast which involves sampling a probability distribution and therefore each time I run the forecast there is some random variation between results. If I run the forecast many times, how do ...
0
votes
0answers
18 views

How to measure deviance resulting from different random seeds in machine learning?

I'm running an xgboost model to predict probabilities to a binary classification problem. Then I aggregate the results based on the Age variable (what is the aggregated risk of getting the sickness ...
0
votes
0answers
7 views

Simulating future customer pucharses given past transactions

I'd like to simulate the customer behaviour given their past purchases or transactions (assuming they behave the same way over time) ...
0
votes
0answers
15 views

Wilcoxon-Rank-Test / Variance heterogeneity and skewed normal distribution / Power Simulation

I observe results that I cannot explain directly. I have created a simulation study where the data generating process follows a skewed normal distribution where the parameters of mean and variance are ...
0
votes
0answers
24 views

Calculate the power of a log rank test for survival outcome using simulated data

I am trying to simulate power using many survival data sets. Suppose, I have 10,000 datasets. For each data set, I can easily calculate the p-value using log-rank test. I would like to calculate power ...
1
vote
0answers
29 views

Multilevel hierarchical simulation? What model to use?

The problem: I have a dataset that I think could be deemed hierarchical. Assume that there are 1-100 ids, which all can have anywhere from 1-3 sub_ids. Both the top ids can have specific features that ...
0
votes
0answers
13 views

How to generate 3 correlated standard normal random variables given pairwise correlation?

I know how to generate normal random numbers given a covariance matrix. However, I am trying to generate sets of correlated standard normal random numbers given pairwise correlations. It is easy when ...
4
votes
1answer
76 views

How to estimate uncertainty in Markov chain simulations

Consider how I fit a Markov chain to my data with R: ...
0
votes
0answers
17 views

(Regression) Confused with the distributions of fitted values, actual response values and simulated values

I have a dataset with, say, $12000$ observations, $1$ response and $10$ covariates. I want to model this dataset using a Lognormal Regression such that the mean function is given by: $E[Y\vert X]=e^{{...
1
vote
4answers
207 views

Can we use linear regression to define the objective function in linear programming?

This is a general question about how linear programming is used in the analytics community. Is it common, or feasible to use linear regression (or perhaps even more complex models like regression ...
3
votes
0answers
35 views

Escape unsuccessful accept-reject step in MCMC

I have an MCMC procedure that samples latent variables $h_1, \dots, h_T$. It is based on Shephard and Pitt (1997), https://doi.org/10.1093/biomet/84.3.653. Let $f$ be the true conditional posterior ...
0
votes
3answers
45 views

Simulating a logistic regression in R

I'm trying to simulate data for a logistic regression experiment to predict $50$ students pass/fail outcome on a math course from their GRE quant. scores. GRE quant. is known to be normally ...
0
votes
0answers
30 views

Bootstrap the estimated GARCH volatility…for the two stage estimation

GARCH(1,1) model is represented as \begin{aligned} x_t &= \sigma_t z_t, \\ \sigma_t^2 &= \omega+\alpha x_{t-1}^2+\beta\sigma_{t-1}^2, \\ z_t &\sim i.i.d (0,1). \end{aligned} If I want to ...
1
vote
1answer
28 views

Simulate GARCH volatility conditional on return series

Is it possible to simulate GARCH volatility series conditional on observed return series? What I want is that my simulated GARCH volatility will incorporate uncertainty of the estimated parameters but ...
1
vote
0answers
39 views

Simulating the annual salary of some lawyers in R

I'm trying to simulate the annual salary of 30, say, lawyers given their years of experience and age. By design, age and experience are extremely correlated with each other. I was wondering if my ...
0
votes
0answers
23 views

How to simulate coefficients from a multivariate distribution and the variance matrix from a inverse Wishart distribution?

I have estimated a Seemingly Unrelated Regression (SUR) and I would like to simulate the coefficients using the posterior distribution. When researching how to do that, I have read that you should not ...
0
votes
0answers
24 views

Pearson correlation not distributed around zero when using nonnegative least squares (NNLS) in permutation test?

I am trying to explain artificially created fmri data in MATLAB [1] through a linear combination of w neural network layers. To compare those, I transformed the data into respresentational ...
6
votes
0answers
32 views

Simulate correlate random variables with given marginal distribution where one is always larger

Is it possible to simulate pairs of random variables with a given marginal distribution and population correlation where one random variable is larger than the other? More formally, I need to simulate ...

1
2
3 4 5
29