# Questions tagged [simulation]

A vast area which includes generating results from computer models.

1,436 questions
Filter by
Sorted by
Tagged with
28 views

### How to simulate an Arima process with random regressor

I'm trying to simulate an arima process with a random regressor that has a certain amount of correlation to the dependent time series. I'm aware of two methods to create simulations of arima models: ...
31 views

### Calculate fifth and sixth polynomials for Headrick (2002) method for non-normal multivariate distribution

I am trying to perform a 3-variable correlated multivariate Monte Carlo simulation. As the asset class returns are non-normal, I found the following function ...
12 views

### Basic Bayesian reinforcement learning algorithm for proportions in R

I'm trying to simulate results from a basic psychology experiment, in which a rat is presented with two levers. Pressing Lever A probabilistically delivers a food pellet at rate $a$. Likewise, Lever B ...
31 views

### Hypothesis test with simulated data

A simulation gave me the following density of data (grey histogram, blue kernel density estimation). Having an alternative input $I^*$ with the same distribution (green line), I would like to check ...
22 views

### Transforming a random sample [duplicate]

For a dsitribution $p(X)$, let $x_1,\ldots,x_n$ be an independent sample of $p(X)$. Consider the one to one transformation $h(\cdot)$ such that $Y = h(X)$. If we apply the transformation to each of ...
12 views

### Should I model co-variance structure in MCMC model for simulation. Or the posterior parameters will have some correlation due to how MCMC works

I am willing to simulate new data points coming from a dataset. The simulated datasets will be used for sampling experiments prior to training machine learning models to the original data using cross-...
92 views

### What should be the burn in period for Metropolis-within-Gibbs?

I need to get samples from an unnormalized distribution $p(\theta, \tau | D)$. However, sampling directly from the joint distribution with Metropolis-Hastings is hard, as the sampler rarely finds ...
27 views

### Restricting Binomial Success Rates in simulation

Suppose I am generating 10000 data points with probability P out of N total trials, but I know that P x N can never be below M, where M < N. How would I go about restricting my simulation to never ...
62 views

### How to simulate predicted probabilities

Can you help me out with the following brain twister? I have a prediction model to estimate the probability (p) of a sale for each potential customer. On average, p is 0.003. (So there is approx. one ...
26 views

### I need to construct function that gives out data of specific pdf function and draw histogram of it [closed]

So, the given density function is: $\theta x ^{\theta - 1}, \ \ if \ \ 0<x<1 \text{ and } 0 \ \ \text{ otherwise}$. $\theta$ is given as 2. I also need to draw a line that corresponds the ...
95 views

### AR(1) with known initial and terminal condition: how to draw the innovations?

Suppose I have the following stationary $AR(1)$ process: $$y_{t}=\alpha_{0}+\alpha_{1}y_{t-1} + u_{t}$$ where $u_{t} \sim \mathbb{N}(0,\sigma^{2})$, with $\sigma^{2}$ known. Suppose I have an ...
23 views

### Isn't a simulation a great model for model-based reinforcement learning?

Most reinforcement learning agents are trained in simulated environments. And the goal is often to maximize performance in this same environment. Why is the simulation not used for planning in these ...
44 views

### How to simulate spatial point patterns that have spatial structure similar to that of given spatial point pattern?

I have some spatial point pattern X distributed in polygon wind and I wonder how can I simulate different point patterns that by their spatial properties (for example, number of points, spatial ...
17 views

### Safety stock calculations using Intermittent Bootstrap

Together with fellow students, I’m working on an assignment to calculate safety stock levels in case of intermittent demand. We’re already able to simulate the demand like in the paper of Willemain, ...
94 views

### Wilcoxon Rank Sum Test vs $t$-test Power Simulation

It is well known that the Wilcoxon rank sum test is more powerful for detecting shifts in location when the data is non-normal. However, I am conducting a brief simulation study and my results ...
93 views

### How can I simulate a student-t copula in R based on marginals?

I'm trying to simulate the joint distribution of Brent oil prices and an exchange rate to compare it to the empirical distribution. For this, I have been following this article: https://...
32 views

### Random Sampling from Farlie-Gumbel-Morgenstern bivariate exponential distribution

I would like to obtain an algorithm for generating iid samples from Farlie-Gumbel-Morgenstern bivariate exponential distribution (as described in the book by Johnson and Kotz as Gumbel's Model II ...
154 views

### inverse transform method [closed]

Using Inverse Transform Method to solve parts of the problem below: (a) Suppose $X \sim \text{Exponential}(λ = 0.2)$. Use RN to generate 20 random realisations of $X$ $\{X_1, X_2, .., X_{20}\}$ ...
12 views

### Resampling method to estimate a reasonable sample size

I would like to know if a method I'm using to determine a sample size is reasonable. In the end of each heavy-ion collision simulation, which I'll call an event, my program computes $N$ possible ...
22 views

### Monte Carlo integration estimating identity operator

I have to calculate the estimator of $\theta=\int_{-1}^{1}|x|e^{-x^{2}}I_{\mathbb{R}}(x)dx$ I implemented the following R code, but I am hesitating about the use of the identity operator. Would be ...
43 views

### Simulating with mixture distribution

I have fitted a gaussian mixture distribution to residuals, and now I want to simulate the residuals. However, I want the model to be independent of the time steps(have it as an input to the model). ...
18 views

### Choosing error for a linear regression model when simulating data for a bayesian sample size determination

Background: I am writing a grant and trying to get a sample size estimate for a Bayesian linear regression. I am trying to link a brain measure to a change in a behavioral measure. So the model is ...
36 views

### Running a simulation: replications or bootstrap?

I draw $n$ iid random draws from a univariate Gaussian distribution. My goal is to estimate the density $f$ using a nonparametric density estimation approach. To add a measure of uncertainty, I want ...
39 views

### Simulation from generalized linear model with specific signal to noise ratio

I am trying to simulate from a generalized linear model (GLM) in a specific signal to noise ratio (SNR) setting, but run in to problems if I try to define a reasonable SNR for non-Gaussian data. In ...
34 views

### How to fit a power curve for a glm with simr

My response variable is counts of turtles at sea surface per aerial survey (possible values: 0,1,2) and I use a Poisson distribution for it (since my data are not overdispersed neither zero inflated). ...
56 views

### Maximum likelihood estimation by simulating the probability density function

Let's say i want to fit a certain exotic distribution using maximum likelihood estimation. However, i have no access to the theoretical probability density function to retrieve the likelihood (it is ...
72 views

### How to simulate from a step (simple function) hazard function?

I have a step hazard function $h(t)$ (a simple function that jumps at specific times and it is constant between those jumps). Something like: How can I simulate survival times from this hazard ...
44 views

### Confidence interval of bootstrapped difference of means

I am attempting to calculate a confidence interval for a difference in 2 populations by means of bootstrapping in order to compare this to an interval calculated via normal theory. I am getting stuck ...
121 views

### What is the relationship between Metropolis Hastings and Simulated Annealing?

Context and Problem In the Wikipedia page for Simulated Annealing they state The simulation can be performed either by a solution of kinetic equations for density functions or by using the ...
37 views

### Interpretation of simulation of chi-square distribution?

I created a simulation study of distribution of $n$ values in an $m$-dimensional table under the assumption that the true distribution is uniform. The goal is to find out why we should be careful ...
44 views

### Distribution of the median of an exponential distribution?

Say i have $X_{ij} \sim Exp(\theta)$ for $i=1...n,\;\;j=1...k$. Afterwards I derive $k$ medians for $k$ groups of size $n$ (even number). The median is a random variable say $M_j$. Do we have any ...
12 views

### How to use bivariate distributions [Year i vs. Year i + 1] to simulate a variable over time in R?

The basic thing I am trying to do is model a person's income over time, using copula functions in R. The data that I have is a bunch of person-level data, which tells us someone's age, their income in ...
15 views

### Conditional draws from a multivariate mixture model keeping one variable fixed

I would like to draw samples from a multivariate mixture model, for a given value of one of the variables. Assuming a gaussian mixture distribution built on $P_{1..p}$ variables with $K$ components: ...
1k views

### Does rnorm produce numbers with replacement/without replacement?

rnorm is an R language function defined as: rnorm.X generates multivariate normal random variates in the space X. Consider <...
66 views

### Simulate Lomax distribution

I want to simulate the Lomax / Pareto type 2 distribution from a standard uniform distribution in python. I managed to transform it into a Pareto distribution, but I'm not sure how to transform it ...
44 views

### Simulating multiple comparisons example

I referred to this question, but found no solution to my problem. I want to simulate a simple case of multiple comparison problem, where family-wise alpha error increases. Question 1 First example ...
8 views

I am trying to simulate a list of transactions of the type that would appear on the bank statement, eg ATM visits rent/food payments, salary deposit, etc. For generating random transactions the focus ...
56 views

### Generate from marginal distribution [duplicate]

Reading a text on Transformation and Variate Generation that says that if we want to simulate V, but we know only its conditional distribution given U, and we can simulate U then we can simulate V ...
47 views

### Predicting a Markov chain next state using previously predicted states

Suppose we have a Markov chain with two states A and B. This associated transition matrix is: \begin{equation} P_{mc}= \begin{...
67 views

### Inconsistent result in checking the approximate exactness of Mood’s median test

I am running a simulation study to check the approximate exactness of Mood’s median test with the following R code (using the RVAideMemoire package): ...
14 views

### Incremental updates for percentile estimates [duplicate]

I want to estimate percentile statistics for time-series pairs $(t, y)$ over varying granularities of time (hour, day, month, etc) For example, if I have the following pairs ...
71 views

### Is it necessary to simulate unbiased coin in using frequentist approach for determining if coin is unbiased?

I’m trying to determine the best way to detect if a coin is unbiased, given some desired alpha. I understand basic probability/statistical inferencing, but there’s some information out there that ...
198 views

30 views

### whats the difference between sample and evaluate?

I'm reading a paper from F. 0. Bunnin, Y. Guo and Y. Ren. They state: Therefore we choose the SIR algorithm, a simulation procedure that requires only the ability to evaluate the likelihood ...
46 views

### probabilistic Loss calculation in excel

This is a homework I received to proceed with an application, which is outside of my knowledge. Any help would be very much appreciated. This may not be the right way to ask questions here, my ...
90 views

### Simr power for interaction: how to set the effect size for interactions?

I want to calculate power for an interaction (two categorical variables, each with two levels). I'm using the simr package. I'm able to calculate the observed power, but now I would like to modify the ...
18 views

### Simulation - Discrete Phase Change

I have a question of how best to approach a problem, I hope this isn't too general. The type of process I'm trying to model is described in the table below: We have a process that we're seeking to ...
I would like to replicate a sample from a population. For this, the distribution (PDF) of $n$ characteristics are calculated. Then I just draw at random from each PDF, and put it as part of the new ...