Questions tagged [simulation]

A vast area which includes generating results from computer models.

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

Question regarding calculation probabilities [closed]

This question is mainly an application of probabilities in real life. In horse racing ,there is a ratio that what we call Stakes Winners to Runners ratios. This is calculated by dividing the total ...
4
votes
1answer
58 views

What are the steps to simulate data for a linear model with random slopes and random intercepts

I have searched this site for existing answers but so far I didn't find anything. I did see this one How to simulate a random slope model Unfortunately it doesn't answer my question. I would like to ...
0
votes
0answers
9 views

Turning a for loop to simulate data into a parLapply that runs on parallel processors [closed]

I currently have a for loop that generates survival data and fits it to three separate joint models. To make this example more reproducible/easier to help, I've changed the joint models to linear ...
0
votes
0answers
15 views

What are the rules to follow for statiscal/econometic modelling on simulated data (OLS, …)? [closed]

I have to create a simple model from 2000 simulated observations that constitute my database. What should I've to consider for my analysis regarding the nature of my data please ? Furthermore, can I ...
0
votes
0answers
33 views

How to simulate two correlated time series

My question is similar to How to simulate two correlated AR(1) time series? but more complex as I want to simulate time series with various AR and MA parts. I have one time series with the historic ...
1
vote
0answers
16 views

Simulation and Power of Factor Interactions

Suppose I am simulating power using the following DGP, consisting of two three-level factor variables and their interaction (for extra clarity, $x_l$ and $z_l$ are binary indicators for each factor ...
0
votes
1answer
39 views

Simulating realizations of joint Bernoulli distribution

Let $X$ and $Y$ be Bernoulli random variables with success probability $p$ and $q$ respectively, i.e., \begin{align*} X = \begin{cases} 1 & \text{with probability $p$} \\ 0 & \text{with ...
0
votes
0answers
28 views

Simulate Non Homogeneous Poisson Process

I've some problems with simulating arrival times following a non-homogeneous Poisson process. I am using the following arrival rate function: $\begin{equation*} \label{eq:lambda} \lambda(t) = \left\{...
1
vote
1answer
10 views

Sampling from interdependent data set

I have a simulation model with trains entering at the limits of the simulation part way into their trip. I have sourced real-world data which provides the variation in the arrival time of these ...
-1
votes
0answers
33 views

Data generation model [closed]

I am comparing the performance of several models in item- and person-parameter estimation in my simulations. These models are: unidimensional, multidimensional, testlet, bi-factor, and higher order ...
0
votes
0answers
7 views

Simulate a column of data with mean, sd constraints, as well as a regression relationship with existing columns

I want to simulate a column of 500 data points with many specified constraints. First, the data should form a bell curve and fall between 0 and 100, with increment of 5, mean = 57, sd = 25.30. Second, ...
3
votes
0answers
24 views

10-faces dice “emulation” from N 6-faces dices [duplicate]

I want to play a game which uses one 10-faces dice, but I only have 6-faces "classic" dices at my disposal. Is it possible to approximately recover, to an arbitrary precision, a 10-faces ...
0
votes
1answer
26 views

Unable to calculate the shape and scale parameters of weibull distribution from data simulated through either gems or simsurv in R

I am trying to simulate survival data from a weibull distribution with shape = 1.3 and scale = 1.1. I am then fitting a weibull survival model to the data, to try and calculate back the values of 1.3 ...
0
votes
1answer
14 views

How to simulate feature changes in machine learning

Situation I trained a machine learning model to predict whether a person will pay back their loan or not. There are about 150 features and 35,000 people in the dataset. Each person represents one row. ...
0
votes
1answer
30 views

While simulating the value of a double integral , why do we need to draw different samples everytime?

Suppose I want to simulate the value of the integral $\int_{0}^{1} \int_{2}^{3} 2xy \ dx dy$ using Monte Carlo methods. So, now, I draw a random sample from $U_1,U_2,...,U_n$ from $U(0,1)$ and for ...
7
votes
3answers
484 views

How to simulate standard deviation

I would like to simulate data based on real data captured. The real data captured is 15 observations. The simulation based on the existing data is 100 observations. I have a mean and standard ...
1
vote
1answer
29 views

How to find cumulative hazard when we have both start time and event time in r

I have the time at start($x_0$) of the study and failure time/censor time($x_t$) for each patient. I want to calculate the Nelson Aalen estimate for each patient and bind it to the data. First of all, ...
3
votes
1answer
50 views

Simulating Outcomes from a Random Effects Model - Strange Behavior when Changing Number of Effects

I've have been doing my best to generate observations from a random effects model so that I can compare estimates of parameters to true parameters for a variety of conditions (like number of random ...
1
vote
1answer
63 views

Analysis model vs. executable implementation of model?

I asked this question on the Operations Research Beta site, but haven't gotten an answer after 5 days. Hoping that this Stack Exchange site is more suitable than Stack Overflow (though the latter ...
1
vote
0answers
32 views

Connecting randomly generated data to the source distribution they were sampled from

The “simulation” approach to probabilities, where you have a model and you simply sample sufficiently many points from a distribution to (hopefully) estimate your probability well enough, is ...
0
votes
1answer
28 views

Cauchy Distribution in R [closed]

Cauchy distribution. Draw 1000 sets of numbers from the Cauchy distribution using set.seed(100). Do this for set size 2, 5, 10 and 20. Compute the median of each ...
0
votes
1answer
38 views

Standard error of model residual SD from simulation

I'm futzing with getting the SE of model residual standard deviations from a linear regression, and keep getting narrower errors than I should - and I'd like to figure out why. The basic approach I'm ...
0
votes
1answer
15 views

How to generate exponentially distributed time period in a stateless manner

I am doing an objected based computer simulation, with some of the objects having a lifetime that persist for an exponentially distributed time. One way to do this is ...
1
vote
1answer
80 views

Simulation of logistic regression's accuracy

I ran a MC simulation of $10^5$ GLM regressions (logistic, logit link) in R. To do so, I assumed: The outcomes ($y$) were repeatedly sampled from a Bernoulli distribution ($N=1000$) The one ...
0
votes
0answers
15 views

Suitable Wording for An Experiment

My question is related to finding a suitable word to demonstrate the following and I wonder if someone could provide me with a proper suggestion! In statistics, if we use a real data set for the Monte ...
5
votes
1answer
62 views

Can this distribution be sampled from efficiently? $f(x) \propto x^{\alpha-1}e^{-\beta x - \gamma/x}$

Consider the density function $$f(x|\alpha, \beta, \gamma) \propto x^{\alpha-1}e^{-\beta x - \gamma/x}.$$ For $\alpha > 0$ and $\gamma = 0$, this clearly reduces to the Gamma distribution. For $\...
0
votes
1answer
20 views

SARIMA: simulation within limits

I am trying to generate hypothetical data through the SARIMA random process. I implement this via statsmodels.tsa.statespace.sarimax.SARIMAX.simulate where I manually define the coefficients. Here is ...
4
votes
1answer
89 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
150 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
51 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
28 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 ...
1
vote
3answers
33 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
59 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)}...
4
votes
2answers
61 views

Generating uniform points inside an $m$-dimensional ball

The present question follows on from some other questions on this site asking how to generate uniform points on 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
975 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
116 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
53 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
24 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
28 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
62 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
31 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
52 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
24 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 ...

1
2 3 4 5
29