Questions tagged [simulation]

A vast area which includes generating results from computer models.

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

Learning a symmetric distribution: best practice for how to treat samples?

There are 169 different types of Texas Hold-em hands. I want to learn the probability of each of them winning through empirical simulation. Note that I'm ignoring all betting considerations (even ...
  • 401
1 vote
1 answer
21 views

How to sample from a distribution with discrete variables with a known average?

My motivation is to produce carcasses of animals in an ecosystem. The animals have discrete sizes in kg (75, 216, 700, 2500, 5000, 8500, 25000). I also have the estimated percentage each animal ...
  • 213
0 votes
0 answers
9 views

Gaussian copula: how to scale data back to get target covariance matrix (not correlation)

I would like to use a Gaussian Copula to simulate data with a given covariance matrix and given marginal distributions. I understand that the input to the copula cannot be the covariance matrix $\...
  • 3,005
2 votes
1 answer
23 views

Need help in understanding how to carryout Discrete Event Simulation for forecasting using the utilities package in R

I am using the utilities package in R to conduct the DES for a forecasting project. My problem involves forecasting the service requirement for patients. On average five patients get admitted to the ...
  • 123
1 vote
1 answer
30 views

How are these simulated sample means created/plotted in R?

I had a student point out this image in Learning Statistics with Jamovi that is also in Learning Statistics with R (Page 294 in the latter). I was going to send her a reply when I noticed something in ...
0 votes
0 answers
25 views

Prediction interval of the future median based on a series of future samples

I am using R and have based my analysis on the book by Hyndman, R.J., & Athanasopoulos, G. (2021) Forecasting: principles and practice, 3rd edition, OTexts using the fpp3 package (https://otexts....
  • 131
2 votes
1 answer
50 views

How to simulate from the Conway–Maxwell–Poisson distribution?

I want to run a simulation study and I need to simulate data from the Conway–Maxwell–Poisson distribution. However, it seems like the probability mass function is not available in closed-form, so, I ...
  • 21
1 vote
1 answer
16 views

Which are the statistical methodologies to consider when examining study group death rates but without considering time to death?

I have a dataset for a group of 66,000 subjects diagnosed with a dangerous condition, and the time it takes for death to occur (the “event”) or to not occur (survival or “censored”). I am pursuing ...
2 votes
2 answers
40 views

switching from probability to classification while maintaining exact ORs

I am trying to create a database with a dichotomized dependent variables and a bunch of binary (1/0) independent variables. I'd like to pre-set some associations between the independent variables and ...
  • 127
0 votes
0 answers
8 views

Compare variance estimators in complex sampling designs by simulations

I need to find the best variance estimator of my parameter $\theta$ using complex sampling data. My survey data with dimension N are drawn with a two-stages stratified sampling. I thus began from my ...
0 votes
1 answer
23 views

Why the actual hazard ratio of the simulated time-to-event data is very different from the expected value?

I am trying to generate time-to-event data for two treatments, with 25 patients in each arm. I generated the survival time in the treatment arm using an exponential distribution with parameter 0.95, ...
  • 11
0 votes
0 answers
12 views

What sensitivity analysis technique is suitable for nominal parameters?

I'm currently developing an agent-based model and at the stage of verification and validation. I'm new to sensitivity analysis and was wondering if you know of any sensitivity analysis techniques to ...
  • 1
4 votes
1 answer
163 views
+100

Generate nonnegative variates with mean 1 and specified variance-covariance

Problem In several applications in surveys, it would be helpful to be able to generate a set of $R$ $n$-dimensional variates with the following properties: Has mean vector $1$ Has a specified ...
  • 242
0 votes
0 answers
27 views

Maximum simulated likelihood of binary logit model implementation in python

I am working through the "Microeconometrics and MATLAB" book, translating the code to Python. Here is my implementation for estimating the parameters of a binary logit model (Colab link). I ...
  • 237
1 vote
0 answers
32 views

Probablistic linear regression predictions for simulation tasks

I have a linear regression task where I am trying to predict in the interval of roughly [-100, 100]. I'd like to build a GBM (it doesn't have to be) that allows me to see the probability distribution ...
  • 216
0 votes
0 answers
24 views

Effect of Simulation Error on the Monte Carlo Estimator

Given a random variable $X$ with known pdf $f$ and some computer simulation model $g(x): \mathcal R \rightarrow \mathcal R$, mapping samples $x \sim f$ to a scalar metric $g$, we can estimate the ...
0 votes
1 answer
85 views

Simulating Outcomes for Skewed Data

I am looking to simulate the results for MLB hitters in terms of their FanDuel and DraftKings fantasy scores. I'm wondering if this is doable given only the following information per player: ...
0 votes
1 answer
36 views

Simulated data (with the outcome and predictors) from a GLM model

The goal of simulation is to produce a number of synthetic datasets, where the outcomes are a function of the known regression coefficients. I would like to know if my reasoning behind creating ...
2 votes
1 answer
32 views

Calculating efficiency of rejection sampling

I have a joint distribution from which I want to simulate $f(x,y) = 2(1-x)(1-y)(1-xy)^{-3}, 0<x,y<1$. I have worked out that the marginal distributions are both $U(0,1)$, so I want to simulate ...
1 vote
0 answers
18 views

How to show in simulations that a method estimates standard errors well?

I would like to compare several ways of computing standard errors for some quantities using simulations, but I don't know what metric should I use for that. I know that for confidence intervals I can ...
  • 7,053
0 votes
0 answers
15 views

How to simulate data with ties in R

I am using R to investigate the effect of tied values on rank-based correlation statistics I wish to simulate correlated bivariate standard normal data with some specified proportion of tied values (...
  • 376
0 votes
0 answers
52 views

Simulating dataset for class

Not sure whether what I’m after is possible, but thought I would ask. I am trying to create a database with a dichotomized dependent variables and a bunch of binary (1/0) independent variables. I'd ...
  • 127
0 votes
0 answers
36 views

Using simulated data to test ML algorithm

For a project I’m working on looking at dichotomous outcomes, we are comparing the ability of different ML algorithms to detect specific culprit factors that are associated with an outcome of interest ...
  • 127
1 vote
0 answers
16 views

How to simulate a SEM Model with Simsem in R [closed]

I would like to simulate a structural equation model in R and fixing the mean and standard deviation for each variable. I attempted to perform a simulation in Onyx, but I can't fix this parameters My ...
0 votes
0 answers
26 views

Factor Analysis: Simulating observations from predetermined factor loadings with beta-distributed variables

I have a question about simulating data in the context of (exploratory) factor analysis. I need to simulate n observations of p measurable variables derived from k latent variables given factor ...
0 votes
0 answers
14 views

Simulating a matrix of variables with predefined correlation structure

For a simulation study I am working on, we are trying to test an algorithm that aims to identify specific culprit factors that predict a binary outcome of interest from a large mixture of possible ...
  • 127
0 votes
0 answers
17 views

Simulating possibly correlated processes of different orders of integration

Given historical data on 6 macroeconomic time series, I am trying to build a model for the purposes of forecasting and simulating. A plot of the (standardised) series is below. A natural choice for ...
  • 442
1 vote
1 answer
64 views

How can I simulate the stationary distribution of particles that each moves differently?

Suppose a particle enters a system at $0.5$ in the unit interval $[0,1]$. With some probability $\lambda_{right}$, particles go right by $$x_{right} = \frac{x\pi_{H}}{x\pi_{H} + (1-x)\pi_{L} }$$ and ...
2 votes
1 answer
58 views

How to simulate data conditional on variables and respecting correlation structure in R [closed]

I try to simulate data for a benchmark multi-dimensional data methods (refer to as multi-omics approaches) with specific correlation structures and depending on others variables. For the first aspect ...
1 vote
1 answer
38 views

Defining censoring level in survival analysis

I'm conducting a simulation analysis using the Exponential, Weibull and Gompertz distribution. To get the times I'm using the table from Austin 2012. But how can I define the censoring level to be ~...
  • 59
2 votes
1 answer
81 views

How to use Monte Carlo simulation to get the conditional mean

Given the following assumptions: $Z,Z'\in\mathbb{R}^4$ where $(Z,Z')\sim N(0,\Sigma)$, for some known $\Sigma\in\mathbb{R}^{8\times 8}$. $Y=f(Z,u,\epsilon)=Z_1\boldsymbol{1}\Big[u<\frac{\exp(Z_3)}{...
  • 123
0 votes
0 answers
17 views

Simulate data based on current dataset

I would like to simulate some data based on a real dataset in order to train some models. The dataset contains student grades which looks like they fit on a log-gamma distribution. In addition, from ...
2 votes
0 answers
61 views

Bayesian calibration of computer simulations - Likelihood function calculation

I am starting to study Bayesian calibrations of computer models. I am not a statistician and just starting to learn so bear with me if I do not use the correct terminology. The general approach is ...
  • 121
4 votes
2 answers
653 views

Simulating Survival Times

I am interested in learning about how to simulate survival times from a Survival Model (e.g. Cox-PH). For example, suppose we fit a Cox-PH Model on some data in R: ...
  • 7,030
0 votes
1 answer
36 views

Simulating a mixture model in time series

Let $\Phi (\cdot)$ be the cdf of the standard normal distribution. Given $(y_t)_{t \in \mathbb N}$ a time series. Suppose $F(y_t | \mathcal{F}_{t-1})$ is the conditional cumulative distribution ...
  • 234
3 votes
1 answer
69 views

Simulating likelihood ratio test (LRT) pvalue using Monte Carlo method

I'm trying to figure out my assignment to simulate lrt test p-value output using the Monte Carlo method. As far as I understand, the lrt test is supposed to test for "better", more accurate ...
2 votes
0 answers
45 views

Why is it easy for the Gibbs sampler to take long time to converge to target distribution?

This is related to Gelman's Bayesian Data Analysis 3rd Edition pg 300 first paragraph of Section 12.4. The book says the following. "An inherent inefficiency in the Gibbs sampler and Metropolis ...
  • 1,315
0 votes
1 answer
27 views

Performance of a bootstrap

In the context of a simulation study, for a bootstrap methodology to estimate a parameter: Should a lots of bootstrap (but each one have a few resamples) be favoured over doing few bootstrap (but each ...
  • 1
0 votes
0 answers
18 views

How can I generate time series with strong autocorrelation?

I'm new in time series analysis. Given an observed time series, actually the history price of certain asset, I tried to resample it to generate surrogate time series for testing purpose. After ...
  • 101
-1 votes
1 answer
100 views

Evaluate integral using R [closed]

I need to evaluate $\displaystyle{\int_{1}^{1}\int_{1}^{1}\int_{1}^{1}(y)e^{x+}}dxdz}$ using in R. Here is my attempt: ...
1 vote
0 answers
51 views

R statistics: compare bayesian bootstrap to frequentist bootstrap for statistics: univariate odds ratio for small sample [closed]

Greetings to the community, I am seeking assistance in finding a solution to the challenges I am facing. OBJECTIVES: I aim to estimate the univariate odds ratio for a binary exposure in a population. ...
  • 11
0 votes
0 answers
10 views

Monitoring convergence of MCMC convergence

I am reading Gelman's BDA 3rd Edition chapter 11 sec 4 on page 284. I do not see what the book means in the following. "When performing inference for extreme quantiles, or for parameters with ...
  • 1,315
0 votes
0 answers
20 views

Correctly visualizing the ergodicity of an AR(1) in R

I'm trying to visualize the mean- ergodicity of a time series and I'm having tremendous doubts about which simulation to use. I show them both and I would like to know which one is correct? Suppose ...
0 votes
0 answers
26 views

How to use Gibbs sampler to simulate normal-normal hierarchical models?

This is related to Gelman's BDA 3rd Edition Chapter 11, Sec 3. The book says the following. "The Gibbs sampler is the simplest of the Markov chain simulation algorithms, and it is our first ...
  • 1,315
0 votes
0 answers
20 views

How to simulate multivariate posterior distribution with a flat prior in general?

If I know that the posterior $p(\theta_1,\dots,\theta_m|y)$ can be written $p(\theta_1|\theta_2,\dots,\theta_m,y)p(\theta_2|\theta_3,\dots,\theta_m|y)\dots p(\theta_m|y)$ where $p(\cdot|y)$ in each ...
  • 1,315
0 votes
0 answers
9 views

Interpretation of strange result on mediation analysis (with simulated data)?

I simulated some data to test a mediation analysis. If I do an "old style" mediation analysis (following this tutorial), I can clearly see the result that I expected: Total effect ...
  • 130
0 votes
1 answer
100 views

Use monte carlo simulation to predict Y variable (linear regression) of a given dataset, and estimate the parameter coefficients

It's my first time learning Monte carlo simulation, I have been given a task to predict the average Y variable (dependent variable) using a given dataset and to estimate the values of the parameter ...
user avatar
0 votes
0 answers
27 views

Simulation of correlated Bernoulli Random Variable [duplicate]

Let $\zeta_x$ and $\zeta_y$ be two Bernoulli random variables with value in $\{-1,+1\}$, and correlation$(\zeta_x, \zeta_y)=\rho$. We know the values of $p^{x,y}=\mathbb P(\zeta_x=x,\zeta_y=y)$ with $...
  • 101
1 vote
0 answers
27 views

How do I generate a conditioned Brownian motion?

Suppose I want to generate a random Brownian motion $B$ on $[0,1]$ such that: $B_0=x_0$ $B_1=x_1$ $\max B_t = M$ $\min B_t = m$ The first two conditions a not difficult to impose. However I have ...
0 votes
0 answers
34 views

How to simulate monotonic data with constrained range?

I'm running simulations for a power analysis for a negative binomial GLMM. The dependent variable has a negative binomial distribution and will be measured at five time points. It has two other ...
  • 200

1
2 3 4 5
37