Questions tagged [simulation]

A vast area which includes generating results from computer models.

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

Partial Variances at each row of a Matrix [migrated]

I generated a series of 10,000 random numbers through: rand_x = rf(10000, 3, 5) Now I want to produce another series that contains the variances at each point i.e. ...
1
vote
1answer
71 views

Drawing a random sample without replacement from data set

I have data generated by a RCT with a control and treatment group, each with n=300, so N=600. The observations are assumed to be i.i.d.. From that population, I'd like to draw 5 random observations ...
0
votes
0answers
18 views

Fit the best distribution on different samples

I have 10 vectors of counts of particular events. For example, in Vec A each event is the count of times I sample a ball of a particular color. For Vec B it's the count of word frequency in a ...
0
votes
0answers
4 views

Interpret the DHARMA simulation for the negative binomial regression

Our response variable is highly skewed and there is evidence of overdispersion as well. We used $pseudo R-squared$ and simulation using the DHARMA package to assess the quality of the model fit. How ...
0
votes
0answers
15 views

Find Infection Rate Pattern (Rt), muT and sizeV (parameter in Covid-19 Simulation [closed]

I'm working on an article and I want to do a simulation of Iran's Covid-19 data. The article is "A novel Monte Carlo simulation procedure for modeling COVID-19 spread over time Abstract". I ...
-2
votes
0answers
16 views

How To Calculate Infection Rate In Covid 19 Computer Simulation? [closed]

I have an algorithm for simulating the covid 19's Infection in every country. I want to calculate the RT or infection rate based on the population. How should i calculate RT or infection rate pattern ....
0
votes
0answers
16 views

Name / packages for using bootstrap samples to validate a statistical formula

I am looking for the name for a statistical validation process where I can quickly validate a theoretical formula, which describes a quantity of interest over a large parameter space, using simulated ...
1
vote
0answers
16 views

Simulating exponential Vasicek/Ornstein-Uhlenbeck

I am trying to simulate commodity prices using the exponential Vasicek/Ornstein-Uhlenbeck model from Schwartz 1997 p. 926 Equation (1). I am using the closed form solution from Vega 2018 p. 5 Equation ...
0
votes
0answers
11 views

How to calculate Spearman's coefficient in a NPV simulation?

I did a Monte Carlo simulation on the net present value (NPV) of an investment. The input variables are: initial investment cost ($I_0$) output volume of year $t$ ($Q_t$) output price of year $t$ ($...
0
votes
1answer
16 views

simulation of mixture GARCH models

I want to simulate data that follow a mixture - GARCH specification. The conditional density of the return series $r_t $, based on information up to time t is given by $ f_{t-1}(r_t;\theta) = \sum_{i=...
2
votes
1answer
17 views

Simulating potential outcomes with a binary outcome

I want to create some simple simulations of potential outcomes to explore issues of confounding. I start with a binary confounder X and a binary treatment A. When my outcome is continuous, I can ...
0
votes
0answers
10 views

simulation log logistic distribution in R [closed]

simulation to generate random number from log logistic distribution with accepted rejection in R
1
vote
1answer
42 views

Algebra for logistic regression slice sampler

I am having some difficulties when trying to do a little bit of algebra from Example 7.11 from the book "Introducing Monte Carlo Methods with R: Robert & Casella" The example relates to ...
1
vote
1answer
30 views

Monte Carlo simulation for grouped averages [duplicate]

Assume we have $N$ random variables $X_1, \ldots, X_N$. As an example, assume that these random variables describe test scores of $N$ students. I am interested in finding the distribution of average ...
1
vote
1answer
27 views

Expected value of subset of variables in Bayesian setting

Assume we have $N$ random variables $X_1, \ldots, X_N$ with known (posterior) distributions that are easy to sample from. For simplicity, assume that I am interested in the expected value of the ten ...
0
votes
0answers
20 views

How to simulate deaths using life/mortality table data?

I am writing a simulation that utilizes mortality tables to determine, at each step of the simulation, the members of the simulation that should die (or "expire", if you prefer). I believe ...
1
vote
1answer
24 views

How Much Time Must the Shopkeeper Wait? — Exponential Distribution

In a store, the distance between customer arrivals follows an exponential distribution with a parameter of 8 minutes. The second seller starts his shift at 10:30 while the last customer entered the ...
0
votes
0answers
10 views

Algorithm to compute p-value of Fisher's exact test based Monte Carlo (bootstrap) simulation

I am looking for code to compute the 1- and 2-sided p-value for Fisher's Exact test for 2x2 tables based on Monte Carlo (bootstrap simulations). For larger 2x2 crosstabulation tables, the exact p-...
1
vote
1answer
25 views

Power analysis/sample size determination by simulation: Optimal algorithm for finding $N$

I want to calculate the needed sample size $N$ to achieve $80\%$ power for a complex longitudinal study design. Because of the complexity of the design and because I want to have control over every ...
0
votes
0answers
14 views

How can I simulate an experiment and account for trial- and subject-level statistics?

I'd like to write some code to simulate a typical experiment but I have a bit of an issue and could use some feedback/ideas. My plan was to simulate a number of individual trials (each with a binary ...
0
votes
0answers
4 views

explanation for a difference between GMM and SMM based on a closed-form equation

It is always said that GMM is used when closed-form estimating equation can be written, whereas in SMM case, there is no closed-form relationship. I am a bit confused about what this sentence really ...
1
vote
0answers
16 views

What reference should I look into in order to “argue” for research methodological decisions between empirical measurements and simulated measurements? [closed]

What reference should I look into in order to "argue" for research methodological decisions between empirical measurements and simulated measurements? That is, given that The phenomenon is ...
0
votes
0answers
23 views

Bootstrapping OLS coefficient variance different results than Python Statsmodels

I wanted to test some basic OLS things in python with a sample dataset. One thing I wanted to test was just getting a bootstrap estimate of the variance of the model's coefficients. Here is the setup ...
0
votes
0answers
4 views

What is the proper specification/classification for estimating # of occurrences until last event in a series of dependent events?

I don't believe this nice answer that in case a) presents a negative binomial and in case b) a scaled/shifted chi-squared is what I'm asking, but I very well could be wrong. Say I have events x1, x2 ...
1
vote
0answers
63 views

How to generate two distinct sets of correlated ordinal variables?

I want to generate two distinct sets of correlated ordinal variables (ranging from 1 to 7). The first set will be represented by x1, x2 and x3 whereas the second set will be represented by x4, x5 and ...
0
votes
0answers
25 views

How does one derive a hypothesis test against extreme outliers?

Say I have $x_1,\dots, x_l$ samples of experiments where $x_i$'s are observed. The extreme studentized deviate is defined by $ESD=max\frac{|x_i-\bar{x}|}{s}$ where $\bar{x}$ is sample mean and $s$ is ...
0
votes
1answer
42 views

Is the median of expected values equal to the expected value of median?

Suppose that an individual $i$ earns $X_{1_i}$ with probability $P_i$ and $X_{2_i}$ with probability $1-P_i$. The expected value of income can be expressed as $E(X_i)=P_i\cdot X_{1_i}+(1-P_i)\cdot X_{...
1
vote
0answers
13 views

Choice of Smoothing Kernel in ABC

In Approximate Bayesian Computation, one approximates an intractable likelihood by convolving it with some smoothing kernel $K$ as \begin{align} \ell^{\text{ABC}} ( x | \theta ) = \int \ell ( z | \...
1
vote
0answers
13 views

Generate data for significance testing

I want to generate a data set with a pre-specified significance level. Let's say we have 2 covariates x1, x2, and an outcome variable y. We fit a linear regression model as follow: ...
1
vote
0answers
24 views

Generating time-series data with known statistics

When I try to implement a parameter estimation method for the first time, such as Maximum Likelihood estimation, I first sample data from a probability distribution, such as a Gaussian distribution, ...
1
vote
1answer
27 views

Insufficient power from pwr.p.test

Using the pwr package, I determined the optimal sample size of 38. However, when I ran simulations using this sample size, I only get a power of 70%. What's going ...
0
votes
0answers
24 views

Generate data from inverse t distribution?

I would like to generate data from an inverse t distribution in R with a particular degree of freedom. I have not been able to find a function for this, but there is a function for generating data ...
0
votes
1answer
18 views

Goto method of simulating regression data for Deep Learning

Short story: How would you simulate tabular data for a Deep Learning regression task? Longer story: Simulating data for linear regression is pretty straightforward (this is Python): ...
0
votes
1answer
17 views

Using npaths in the forecast function in R vs arima.sim() function

I have data for 100 days which I've already fit using an ARIMA(0,1,1) and I'm looking to forecast my potential returns for the next 5 days. Furthermore, I'm assuming the returns are independent and ...
3
votes
1answer
49 views

Simulating $f(Ax + b)$

Let $f_1$ be the density function of the logistic distribution, and let the product density function $f(x,y,z) = f_1(x)f_1(y)f_1(z)$. A $3 \times 2$-matrix $A$ is given. Its two columns are orthogonal ...
0
votes
0answers
27 views

book suggestion about statistical tests comparison with R

Is there any book with examples on how to compare two statistical tests in R? For example, I'd like to see the possible differences in significance level and power between the chi-square test and the ...
5
votes
1answer
201 views

Probabilities arising from permutations

Certain interesting probability functions can arise from permutations. For example, permutations that are sorted or permutations that form a cycle. Inspired by the so-called von Neumann schema given ...
0
votes
0answers
15 views

Sequential Monte Carlo Sampler - Distribution of samples AFTER multinomial resampling?

Brief Recap on SMC Sampler The Sequential Monte Carlo Sampler by Del Moral et al (with resampling at every step) works as follows: Sample $N$ particles from Kernel (or from initial proposal $\eta_1$ ...
0
votes
0answers
19 views

Synthetic or simulated data

I need to develop a set of simulated or synthetic (numeric) datasets to evaluate a data fusion framework I have proposed. I already have a real-world data set but I need to test the framework for some ...
1
vote
2answers
54 views

Monte-Carlo Simulation for Quantile Regression

I am trying to perform a Monte-Carlo simulation using R. Currently I am getting stuck simulating the data. In a usual regression setting I would draw a random sample of the independent data and then ...
0
votes
0answers
15 views

Generating Low-Rank (correlated) Uniform Random Samples

I'm looking to generate $n$ uniform random samples that occupy an ambient dimension $D$ but live on a $d$-dimensional linear subspace. I know how to do this form normal samples. Specifically, given ...
0
votes
0answers
14 views

Calculating the number of excursions in a Gaussian

I've written an algorithm designed to solve the following problem: An m x n array, where m and ...
0
votes
2answers
58 views

Model that takes two percentiles as input - what is the percentile of the output value

For some analysis I have two input variables with some (unknown) probabilities distributions. Of both the input variables I know the (assumed) 10th, 50th and 90th percentile. I have some simple model ...
0
votes
0answers
14 views

Comparing the mean of two results, knowing the intermediate precision

Currently, I am analyzing the results of an assay that has been performed for two experiments, and I would like to know whether the results are the same. I do have the assay results (1 result for ...
1
vote
2answers
50 views

How to simulate a new variable in regression analysis

Suppose my current regression model is $y=\beta_0+\beta_1x_1+\beta_2x_2$ Now I want to add a new variable $x_3$ (normally distributed). All I know is $x_3$'s mean and standard deviation. Is it a sound ...
0
votes
0answers
33 views

Generating correlated discrete random variables

Suppose that we have $q_t \in \{-1, 1\}$ where $\mathbb{P}(q_t = -1) = \mathbb{P}(q_t = 1) = \frac{1}{2}$. Further, assume that \begin{align} Cor\left( q_t, q_{t-k} \right) = \begin{cases} ...
1
vote
0answers
15 views

How to sample a joint posterior given multiple models?

Consider having two models, $m_1$ and $m_2$, for a set of data $x$, each model has associated parameters $\theta_1$, for model one, and $\theta_2$ for model two, (not necessarily the same dimension). ...
1
vote
0answers
15 views

Simulate data with directions with equal variance and apply PCA

I would like to simulate $N$ observations for the single feature $X$ starting from a simple linear factor model of the form $X=A*P$ where $P$ is the factor matrix of the $K$ factors. Then, I would ...
2
votes
0answers
38 views

Computationally estimate $E[f(\hat \beta_1 X)]$ where $\hat \beta_1$ is the estimated coefficient obtained by ordinary least squares regression?

Let $(X_1,Y_1),(X_2,Y_2),\dots,(X_5,Y_5)$ be i.i.d samples and consider the regression model $$ Y_i = \beta_0 + \beta_1 X_i + \varepsilon_i, \quad \quad \text{for} \ i \in \{1,2,\dots,5\}, $$ where $\...
1
vote
0answers
16 views

verifying Asymptotic Distributions using simulation methods [closed]

I've created 10 thousand simulated time series with sample size $T = 200$, simulated with a given autoregressive parameter ($\theta_0$ = 0.3) and for each I've estimated the autoregressive parameter ...

1
2 3 4 5
30