Questions tagged [montecarlo]

Monte Carlo methods are stochastic (probabilistic) systems that use many random samples to derive properties of a complex system.

Monte Carlo methods are stochastic methods that use large sample sizes to gather information about a complex system. The outcomes of these trials can then be used to draw generalizations about the system as a whole, without first needing a proper solution.

Monte Carlo methods are especially useful when a numeric solution is available, but which is too complex to solve for directly. They are general enough that their use is widespread; Wikipedia provides a list too exhaustive to reproduce here.

1260 questions
0
votes
1 answer

R Monte Carlo Simulation Price Path Converging Volatility Issue

I use R to simulate the price path of a stock with volatility of 0.25, then I calculate the volatility of those simulated path. I found that when the number of simulation steps is small, e.g., less than 75 steps, the volatility of simulated price…
2607
  • 4,037
  • 13
  • 49
  • 64
0
votes
1 answer

Is there a way to test the quality of a PRNG for multidimensional use?

I'm in the process of evaluating some PRNGs, both in terms of speed and quality. One aspect of quality I want to test is multidimensional distribution and bias. I know of TestU01's batteries, and I plan on using them (and, perhaps, others that the…
Cornstalks
  • 37,137
  • 18
  • 79
  • 144
0
votes
1 answer

R: Distribution of Random Samples vs. 1 Random Sample

I have a question about random sampling. Are the two following results (A and B) statistically the same? nobs <- 1000 A <- rt(n=nobs, df=3, ncp=0) simulations <- 50 B <- unlist(lapply(rep.int(nobs/simulations, times=simulations),function(y)…
Brad
  • 813
  • 1
  • 10
  • 20
0
votes
1 answer

How to do MCMC simulation using Metropolis hasting algorithm in Matlab?

I am trying to simulate a distribution for parameter theta f= theta ^(z_f+n+alpha-1)*(1-theta)^(n+1-z_f-k+ beta-1), where all the parameter except for theta is know. I am using Metro polish hasting algorithm to do the MCMC simulation . My proposal…
Spandyie
  • 914
  • 2
  • 11
  • 23
0
votes
1 answer

Use Thust OMP to parallelize a Monte Carlo on CPU

The goal is to parallelize a Monte Carlo process using thrust::omp int main() { unsigned Nsimulations = 1000; // construct some objects here that will be required for Monte Carlo A a; B b; C c; /* * use thrust::omp to run the…
Boraxis
  • 89
  • 1
  • 9
0
votes
1 answer

Simulating Integrals with Monte Carlo method

I´m trying to transform the integral: I need to transform it to an integral that goes from 0 to 1 in order to apply the algorithm of Montecarlo I implemented. I´m comfortable applying the identities on single integrals, but I don´t really know how…
Pablo Estrada
  • 3,182
  • 4
  • 30
  • 74
0
votes
1 answer

MATLAB: Pricing a digital option, Monte Carlo vs. explicit integral formula?

I am stuck with the following problem using MATLAB: Let Z be lognormally distributed such that ln Z has mean m and variance w. Let eta be a negative number and c a positive constant. I am trying to compute the expected value (let I(Z<=c) denote the…
Tim
  • 11
  • 1
0
votes
1 answer

Why power of two for systems sizes in numerics

This could be a very trivial question. I often see in the literature that the system sizes are chosen in a numerical calculation as a power of two. For example, for a Monte Carlo simulation on a spin lattice, the lattice size is often chosen as…
hbaromega
  • 2,317
  • 2
  • 24
  • 32
0
votes
1 answer

Lone reference error when calling INDEX with RANDBETWEEN in Excel

I'm trying to do some bootstrapping with a data set in Excel with the formula =INDEX($H$2:$H$5057,RANDBETWEEN(2,5057)), where my original data set in is column H. It seems to work most of the time, but there is always approximately one cell that…
0
votes
2 answers

Using proc iml to do monte carlo integration

proc iml; call randseed(4545); * initialize the stream (like streaminit); x = J(5000,1,.); * pre-allocate space for random numbers; call randgen(x,'normal',0,1); * fill x with N(0,1) deviates; y = y + (x**2 - 3*x**3 + 5x < 1); p = y / 5000; * MEAN…
0
votes
1 answer

Monte Carlo Simulation - float' object is not callable

Consider the following function that generates k Monte Carlo estimatives for an Integral with size n: def MCExponencial(k, n): sample=[] values=[] estimative=[] for j in range(k): sample = [geradorExponencial(L, e1, e2) for i in range(n)] …
Giiovanna
  • 424
  • 6
  • 21
0
votes
2 answers

Markov Chain Monte Carlo, proposal distribution for multivariate Bernoulli distribution?

Is there a suitable proposal distribution for multivariate Bernoulli model ? for example I want to sample from a probability distribution p(x) = p*(x) / Z; where x = {0,1}^M and Z is the normalization constant, Which is intractable to directly…
Jing
  • 895
  • 6
  • 14
  • 38
0
votes
1 answer

Monte Carlo simulation of a whole matrix in Stata

I would like to compute a summary statistic of a set of groups within my data (such as age,sex) with confidence intervals. For that purpose I use monte carlo simulation drawing values from a Poisson distribution for every row in my data and then…
0
votes
1 answer

Monte Carlo sweep in Cuda

I have a Monte Carlo step in Cuda that I need a help with. I already wrote the serial code, and it works as expected. Let's say I have a 256 particles, which are stored in vector< vector > *r; Each i in r has (x,y) component both of which…
jimmu
  • 1,025
  • 1
  • 10
  • 15
0
votes
0 answers

Monte Carlo and Cholesky Decomp

I'm trying to simulate two random variables: One with a Normal Dist. and one with an Exp dist. I've run into issues as I cannot seem to find a good way to specify a different distribution for each variable. The column "row.names" is created…