Questions on Monte Carlo methods, methods that require the repeated generation of (pseudo-, quasi-)random numbers for computing their results.

learn more… | top users | synonyms

2
votes
0answers
367 views

Particle filter motion model

As I understand the basic idea of particle filter is to predict the state of the particle by generating N different possible state. After that, each possible state is evaluated by a predict model (...
1
vote
2answers
125 views

Monte Carlo Simulation- Simulating Sum of a DICE. Matlab CODE.

Hello everyone, I try to solve the following problem: Use Monte Carlo simulation to approximate the sum of the 100 consecutive rolls of a fair die. My work in math lab is: ...
1
vote
3answers
132 views

How do I generate $100$ numbers in $[0,1]$ which are more dense at $0$ and $1$?

I just need to generate random numbers in $[0,1]$ which are more dense at the end points. I first thought of generating two sets of numbers from $N(0,1)$ and $N(1,1)$, and then using those. But that ...
1
vote
3answers
4k views

transformation of integral from 0 to infinity to 0 to 1

How do I transform the integral $$\int_0^\infty e^{-x^2} dx$$ from 0 to $\infty$ to o to 1 and. I have to devise a monte carlo algorithm to solve this further, so any advise would be of great help
1
vote
1answer
35 views

Understanding claim in Newman and Barkema's Monte Carlo book

In Newman and Barkema's Monte Carlo Methods in mathematical physics, on page 23-24, the following claim is made: "Assume we have a function f(x) and the integral $I(x)=\int_0^xf(x')dx'$. Then pick a ...
1
vote
1answer
157 views

Monte Carlo gamma function

This question was asked before but I'd like to ask something more precise given the answer that was given. [ Estimate gamma function using monte carlo ] What is the criterion for a random point to ...
1
vote
2answers
64 views

Probabilities seem to be growing exponentially

We have instituted random drug testing at our company. I was charged with writing the code to generate the weekly random list of employees. We've gotten some complaints because of people getting ...
1
vote
3answers
3k views

Using loop to approximate pi (Monte Carlo, MATLAB)

I've written the following code, based on a for loop to approximate the number pi using the Monte-Carlo-method for 100, 1000, 10000 and 100000 random points. ...
1
vote
1answer
115 views

Monte Carlo estimations of e

I need to estimate $e$ with a monte carlo method. We only learned the crude monte carlo integration, so I can't use any robust monte carlo simulations. I know that $\displaystyle \int\limits_1^x \...
1
vote
1answer
204 views

Do random numbers have an “error”? If so, how can I calculate it?

In numerical mathematics, we have to approximate the value of $\pi$ using three different methods. One of the three methods is the Monte-Carlo method, i.e. I let Matlab produce $n$ random numbers ...
1
vote
2answers
199 views

Stochastic/finance monte carlo question

When pricing a european option by monte carlo over 30 days for instance, what's the difference between one big 30 day jump vs 30 one day steps?
1
vote
1answer
37 views

Debugging a Metropolis Hastings Algorithm Simulation

I have some questions about the Metropolis Hastings algorithm: Wikipedia says: ...choose an arbitrary probability density g(x|y) which suggests a candidate for the next sample value x, given ...
1
vote
3answers
885 views

Evaluating Difficult Monte Carlo Integration in R

I recently posted a simple version here (Simple Monte Carlo Integration). I was able to verify that the answer was indeed close to 1/3 when I wrote the following R code, and got a mean of X of ~1/3: ...
1
vote
1answer
92 views

Resolve integral with importance sample Monte Carlo

I'm trying to compute the integral $$\int_{a}^{b}(\sin( 1 + x ) + \cos( 1 + x ))e^{-x}\ dx$$ using importance sample Monte Carlo method. The exercise ask to use Cauchy Distribution to resolve the ...
1
vote
1answer
42 views

Question about the Monte Carlo Algortihm

I was reading the Monte Carlo algorithm for finding the area under a curve, say $y=f(x)$. The algorithm considers, $0\le f(x)\le M$ over the closed interval $a\le x\le b$. My question is,that why is ...
1
vote
1answer
174 views

Alternatives to Monte-Carlo simulation

Imagine I have a model of economy of a region, which consists of several companies, importers and population. Let's assume that all local companies in question produce food and agricultural ...
1
vote
1answer
173 views

Three ideas of perfect sampling

From David J.C. MacKay's Information Theory, Inference, and Learning Algorithms 32.2 Exact sampling concepts Propp and Wilson's exact sampling method (also known as "perfect simulation" or "...
1
vote
1answer
566 views

Exponential Probability Monte Carlo simulation

I need to write a Matlab program to estimate the quantity $\theta = \mathrm{Pr}(X < 1)$, where $X$ is an exponential random variable with mean $1$. I am doing this for multiple monte carlo ...
1
vote
1answer
30 views

Limiting Distribution of a Gibbs Distribution

I know that the Gibbs distribution at a particular state, x, is given by $\frac{e^{-\beta E_i}}{\sum_j e^{-\beta E_j}}$ with $\beta = \frac{1}{T}$, but I do not understand what a limiting distribution ...
1
vote
1answer
32 views

Correlation Matrices proofs

(*) says that the diagonals of $R$ are $1$ and the non-diagonals are the correlation, $p$. I planned on simplifying both equations until they're equivalent, but I'm not sure how I could go about ...
1
vote
1answer
45 views

Related problem to covering a circle with random arcs

I have a problem setup wherein we have (the following are all integers) a sequence of length $G$, and $N$ reads of length $L$. I'm interested in the problem where we consider the sequence to be ...
1
vote
1answer
21 views

Why does this MCMC algorithm to estimate parameters of a linear equation not converge to the posterior distribution?

As a kind of proof of principle I'm trying to estimate the parameters of a linear equation (before moving on to ODEs) using Markov Chain Monte Carlo sampling. The post that I am following can be found ...
1
vote
1answer
35 views

Mistake in generating random numbers - no irrational ones

Hi I just wondered if the probability densities have to be corrected when using them on a PC since the number representation is not at all continuous. So we cant simulate any irrational numbers and ...
1
vote
1answer
20 views

Efficient methods for drawing random numbers and Monte Carlo for Tsallis q-Gaussians

I would like to draw random numbers from the q-Gaussian used in "Tsallis statistics." This is specifically the distribution $$ f(x) = {\sqrt{\beta} \over C_q} e_q(-\beta x^2) $$ where $$ e_q(x) = [1+(...
1
vote
1answer
35 views

Equivalence of Probability spaces. Monte carlo integration

Pondering about the independence of dimension of Monte Carlo Integration, I came up with the following explanation: An integral over a square is not harder, thus has the same rate of convergence, ...
1
vote
2answers
131 views

Approximating an integral using Monte Carlo Method

I wrote a solution for Calculate the value of the integral I = $\int_0^\pi sin^2(x)dx$ using the Monte Carlo Method (by generating $ 10^4 $ uniform random numbers within domain [0, π] × [0, 1])...
1
vote
3answers
819 views

Random directions on hemisphere oriented by an arbitrary vector

Hy, i'm writing a raytracer, and for that I need to generate n random vectors that are inside an hemisphere oriented by the surface normal. Ideally, I would also like being able to restrict the rays ...
1
vote
1answer
77 views

Compute the Std. Deviation of Multiple Monte Carlo Estimation of $\pi$

For a school programming assignment, I am trying to compute the value of $\pi$ via the classic Monte Carlo estimation of $\pi$. In the experiment, we throw a variable number of darts at a circle that ...
1
vote
1answer
84 views

Numerical CDF estimation for complicated random variable

Given a combination $U$ of several random variables $X,Y,Z...$ with known distributions, what is an efficient numerical algorithm to estimate PDF or CDF of $U$, if its CDF, PDF, characteristic ...
1
vote
1answer
45 views

Generating two $-1$ correlated Poisson random variables with parameter $5$

Is it possible to generate two random variables $X$ and $Y$ that are both $Poisson(5)$ with $Corr(X,Y)=-1$? Why? I was thinking about generating $3$ independent Poisson random variables $Z_1,Z_2, and ...
1
vote
1answer
126 views

How to mathematically prove that we are sampling from same distributions?

The content of this question is about rigorously proving something which is otherwise considered easily correct intuitively. Let's assume we have a multivariate distribution $g(x_1,x_2,...,x_n)$ over ...
1
vote
1answer
37 views

Bias Method in monte carlo integration

This is from a proof in my monte carlo course. let $h$ be a smooth function, $T_n = h(\bar{X})$ $\mu = E(X)$ then by taylor expansion $E(T_n -\tau) = E[h(\bar{X} -h(\mu)] = E[\bar{X} - \mu]h'(\mu)+ \...
1
vote
1answer
142 views

Monte carlo estimation of maximum likelihood estimators

I'm interested in numerically finding the maximum likelihood estimator of a parameter $\theta$, as well as the confidence interval of this estimator. First I'll describe the method I've been trying, ...
1
vote
1answer
325 views

What is the typical method for sampling uniformly in a convex polytope

The polytope in my case is the intersection of the k-plane $Ax=b$ and $\{x>0\}$ where $A$ is the constraint matrix and $b$ is some solution. I'd like to find a method that is fast and efficient for ...
1
vote
2answers
186 views

Monte Carlo Integration - determining if a random x,y coordinate falls within the circle or square

My textbook says you can take any random (x,y )coordinate between -1 and 1 like (-.3, .5) or (.4, -.7) and determine if the given coordinate falls within the circle if you calculate $\sqrt(x^2+y^2)$ &...
1
vote
1answer
34 views

Condition for Law of Large Numbers, Monte Carlo

In some lecture notes I am reading, there is the following; Consider $X_{1},...,X_{n}$, each with pdf $g$ (the instrumental distribution). Our aim is to estimate $E_{f}[h(X)]$ where $h(X)$ is some ...
1
vote
1answer
75 views

Question on Joint Posterior

Likelihood: $f(x^T, n^T|\theta^T) = \prod_{i=1}^{30} \binom{n^T_i}{x^T_i}{\theta^T}^{x^T_i}{(1-\theta^T)}^{n^T_i-x^T_i}$ Prior: $ log(\frac{\theta^T}{1-\theta^T})\sim N(\mu_T,\sigma_T^2) $ I am ...
1
vote
1answer
149 views

Quasi-random sequence on the unit $2$-sphere for Monte-Carlo based method

Please forgive my possible misuse of the appropriate definitions. I'm looking for a quasi-random sequence of directions in the unit $2$-sphere, to be used in a Monte-Carlo method to calculate an ...
1
vote
1answer
110 views

Use of this condition on the instrumental density in importance sampling?

From Rubinstein's Simulation Monte Carlo Method, assume r.v. $X$ has density function $f$, $H$ is a measurable function, and $g$ is another density function. If $g$ dominates $Hf$ in the sense that $g(...
1
vote
2answers
1k views

Monte Carlo simulation on sphere: unbiased random steps

Im doing a Metropolis Monte Carlo simulation with particles on a sphere and have a question concerning the random movement in a given time step. I understand that to obtain a uniform distribution of ...
1
vote
1answer
78 views

Should I ignore $0$ when do inverse transform sampling?

Generic method Generate $U \sim \mathrm{Uniform}(0,1)$. Return $F^{-1}(U)$. So, in step 1, $U$ has domain/support as $[0,1]$, so it is possible that $U=0$ or $U=1$, but $F^{-1}(0)=-\infty$. ...
1
vote
1answer
191 views

Help me with Monte Carlo method : Importance Sampling

I have a little problem with applying a Monte Carlo method: Importance Sampling. I need to calculate: $$ \int_0^\infty \int_0^\infty \frac{dx\;dy}{2 \pi (1 + x^2 + y^2)^{3/2}} $$ Can somebody help ...
1
vote
1answer
176 views

A problem of inversion method for sampling

I am reading the book Stochastic Simulation, Algorithms and Analysis by Asmussen. On page 39, when talking about inversion method for sampling a distribution, he gave an example: an r.v. ...
1
vote
0answers
45 views

How can I generate random samples from following probability density function?

Let $\mathbf{\alpha}=(\alpha_1, \ldots, \alpha_m)$. The posterior density function of $\mathbf{\alpha}$ is given by $$h_0(\mathbf{\alpha}|\mathbf{x})=‎\frac{\prod_{i=1}^{m}\alpha_i^{a_i}}{\left(1+\...
1
vote
0answers
18 views

Stratified Sampling $E(E(X \mid \mu, \sigma))$

Let $X$, $\mu$ and $\sigma$ be random variables. I want to estimate $E(X)$ using Monte Carlo. I am able to sample from, and know in closed-form, both the conditional distribution of $X \mid (\mu, \...
1
vote
0answers
28 views

Monte Carlo Search Tree iterations

I have had this example in my exam last week and I can not figure out how to solve it. I have watched lots of tutorials on Monte Carlo Search Tree but I can't still understand this algorithm properly. ...
1
vote
0answers
46 views

Scrambled Sobol

I need to do a Monte Carlo simulation in high dimension (up to 1000) where using plain Sobol (with Kuo's direction vectors) as a random number generator is not good enough. Therefore I am ...
1
vote
0answers
37 views

Approximating Minkowski Sum of 3 dimensional Convex Polytopes by Sampling

Let $P_1,P_2...P_r$ be a set of convex polytopes with $n_r$ vertices in 3 dimensions. These polytopes basically represent uncertainties of '$r$' number of 3d-points respectively in space. The global ...
1
vote
1answer
43 views

Log normal simulation.

I want to calculate numerically the expectation of a lognormal random variable $Y=e^X$, where $X$ is normally distributed with mean $m$ and variance $V$. The expectation is known as $e^{m+\frac{1}{2}...
1
vote
0answers
11 views

Quasi-Monte Carlo with Conditional Distributions

I want to estimate $E(f(X))$ using quasi-Monte Carlo where $X = (X_1,\ldots,X_n)$ is a random vector and $$ X_i\sim f(\cdot; \theta), \quad \text{independent}, $$ where $\theta \in \mathbb{R}$ is some ...