Questions tagged [monte-carlo]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
43 views

Solve for withdrawal rate in Monte Carlo simulation of retirement

I've been working with compound returns and distribution of wealth over time for quite some time now and I feel like I am hitting a wall. What am I trying to achieve? Imagine that you are about to ...
0
votes
0answers
23 views

Exponential tilting for $E[1_{\{X > c\}}]$

Let's define $c \in \mathbb{R}$ and $X \sim N(0, 1)$. I want to define exponential tilting estimator for parameter $\delta := E[1_{\{X > c\}}]$. My work so far Exponential tilting is special case ...
0
votes
2answers
38 views

Monte carlo variation of $E[1_{\{X>0\}}]$

Let's assume that $X \sim N(0, 1)$. I want to calculate variation of crude monte carlo estimator of parameter $\delta = E[1_{\{X>0\}}]$ My work so far Let's generate $x_1, x_2, x_3,..., x_n \sim N(...
2
votes
1answer
56 views

Find an estimate for $\int_{\pi/2}^\pi \sin(x) dx$ using the Monte Carlo Simulation

I want to find an estimate for $$\int_{\pi/2}^\pi \sin(x) dx$$ I want to use the monte carlo simulation method. I've plotted the graph of $\sin(x)$ in the given interval. The total area $$\begin{align*...
1
vote
0answers
26 views

Generating random variable from no closed-form marginal density using r or other programming language

Suppose $U\sim N(0,I_p)$, $Y|U\sim N(x(t),\sigma_e^2I_m)$, and the marginal distribution of $Y$ is $f(y)=\int_u f(y|u)f(u)du$. $x(t)$ is composite function of $U$, basically $x(t)$ is a function of $z(...
0
votes
0answers
30 views

Quick question: Using conditional expectation as a scalar.

Following on from this question: Quick Question: using expectation as a scalar Given Random Variables: $X_i \underset{iid}{\sim} z$ forming a random sample of z where z is some >distribution and ...
3
votes
1answer
41 views

Quick Question: using expectation as a scalar

I'd like to ask a question about possible rules of expectation when we can and can't use them "as if" they were scalars. Given Random Variables: $X_i \underset{iid}{\sim} z$ forming a random ...
0
votes
0answers
12 views

Bayesian matrix factorization - How to estimate variance using MCMC(Gibbs Sampling)

I have implemented a Gibbs sampler for Bayesian Matrix Factorization /Completion of matrix $R = (r_{ij})$ which is $(N, M)$ dimensional and $p(r_{ij} \mid \mathbf{u}_i, \mathbf{v}_j) = N(r_{ij}\mid\...
0
votes
0answers
33 views

Monte-Carlo Estimate of an Integral on a Riemannian Manifold?

Suppose I have a function $f:\mathcal{M} \rightarrow \mathbb{R}$, where $\mathcal{M}$ is a Riemannian manifold. I would like to compute the monte-carlo estimate of $\int_{y \in \mathcal{M}} f(y) \...
0
votes
0answers
9 views

Sampling from a joint distribution with known marginals and dependency structure

Assume that $(X_1, X_2, \dots, X_m) $ are $m$ real-valued random variables with comonotonic dependence. This means by definition that there exists distribution functions $F_1, \dots, F_m$ with ...
0
votes
1answer
33 views

Distribution of relative error.

Suppose I have a random variable $X$ with unknown mean $\mu$ and I can draw $n$ random samples (possibly from a Monte Carlo method, but I believe that's beside the point) from its distribution. I wish ...
0
votes
0answers
15 views

Statistical justification for monte-carlo dropout rate in neural network

Context: Monte-Carlo dropout is the process of randomly setting a number of units in a neural networks hidden layer to zero at test time. This makes the prediction process stochastic, so a cohort of ...
0
votes
0answers
16 views

Change of Measure for Importance Sampling

Let $\lambda$ be the Lebesgue measure. Suppose $\pi \ll \lambda$ with density $f_\pi$, $q \ll \lambda$ with density $f_q$ $\pi \ll q$ with density $f_{\pi,q}$ Can I write $$ f_{\pi, q} = \frac{d\pi}{...
0
votes
0answers
17 views

Standard Error interpretation for the Monte Carlo estimate of the mean differences.

I am estimating the Monte Carlo mean difference of two idd uniformly distributed $X_{1}$ and $X_{2}$ and its standard error. $$\hat{\theta} = E|X_1 - X_2| \quad \text{ and } \quad \hat{se}|X_1 - X_2| ...
0
votes
0answers
28 views

The rate of convergence of the Markov chain to the stationary distribution

Let $X_t$ is Markov chain with transition rates $c: G \times G \rightarrow [0: +\infty)$, where $c(x, y) > 0$, $c(x, x) = -\sum_y c(x, y)$ for $x \neq y$. If $\mu_t(x)$ is the distribution of chain ...
0
votes
0answers
19 views

Calculate the given integral using Monte Carlo method

approximate the integral using Monte Carlo method. $\int _{r\in B} \frac{1}{|r-r_0|}dr$ , while $r_0 = (1,1,1)$ and B={(x,y,z): $x>0$,$y>0$,$z>0$,$x+y+z < 1$}. I'm trying to solve the ...
1
vote
0answers
66 views

Monte Carlo Rejection Sampling

I have the function which I am trying to use calculate monte carlo estimate on using rejection sampling. $f(x) = \int_2^\infty x^4 \sin(\pi(x+1)) e^{-x^2/2}dx$ My initial thought was that I could ...
1
vote
0answers
20 views

Inverse transform sampling for piecewise function

https://stats.stackexchange.com/questions/447035/inverse-transform-method-with-piecewise-pdf I have the same question as the one above, which was wasn't answered. I am doing inverse transform sampling ...
0
votes
0answers
12 views

Confidence interval in Binomial/Poisson-stochastic differential equations

I'm simulating loads of Stochastic SIR-model trajectories from a model on the following form: \begin{align} \begin{split} \Delta S &= - \text{Po}(S_k \cdot p_I(t))\\ \Delta I &= \text{...
0
votes
0answers
21 views

Can the definite integral of zero valued function be non-zero?

I am trying to understand the Importance Sampling Technique (IS) for rare event simulation. I use the this tutorial. On page 5, it is written: "...That is, let g be another probability density ...
0
votes
1answer
58 views

Sample size for a given accuracy, at estimating $\pi$ by the Monte Carlo method.

I have the following problem: For the classical technique for estimating $\pi$ by using the Monte Carlo method, find the minimum number of points $n$, such that (being $\hat{p}$ our estimator) we get ...
0
votes
0answers
22 views

Convergence of monte-carlo methods.

Consider an algorithm to calculate $\pi$. Take a square $[0,1]\times [0,1]$ and make a quarter circle inside it of radius 1 centered at one of the corners. Now choose $N$ uniformly distributed random ...
0
votes
0answers
51 views

Solving a 3 dimensional Integration using a monte carlo method

The goal is to come up with a method to use a monete carlo method to solve $$\int_{-\infty}^{\infty} \int_{0}^{2}\int_{0}^{\infty} y^2\cos(\pi(xy + z) e^{-x^2}e^{-z} \,\mathrm{d}z\,\mathrm{d}y\,\...
1
vote
0answers
10 views

Difference between pseudo-convergence and initial transient problem

I am trying to understand the difference of the initial transient problem and pseudo-convergence when it comes to MCMC convergence diagnostics. I found the following explanations for the problems: ...
0
votes
0answers
8 views

Sampling Algorithms in ML course

I am interested in learning about sampling algorithms in ML. It has been a hard time to find a consolidated resource to learn about this topic. I am looking for a course (a book will also do) with ...
0
votes
0answers
27 views

Proof of the Invariant of a Random Scan Gibbs Sampler

The 2 steps pointed at are confusing me: Q1: How has integrating over $x_{-i}$ combined the dirac $\delta$ masses and $\pi(x)$ terms and how has $y_{-i}$ replaced $x_{-i}$ in its argument?(I don't ...
0
votes
0answers
37 views

Compute a Monte Carlo estimate. Which of the variances (of $\hat{\theta}$ and $\hat{\theta}^{*}$) is smaller, and why?

Compute a Monte Carlo estimate $\hat{\theta}$ of $$ \theta = \int_{0}^{0.5} e^{-x} dx $$ by sampling from Uniform$(0, 0.5)$, and estimate the variance of $\hat{\theta}$. Find another Monte Carlo ...
0
votes
1answer
14 views

Can I apply z-test after MonteCarlo sampling

I'm trying to compare whether two datasets come from the same distribution, and to do this I was thinking of using the z-test. However, the data is not normally distributed, and to fix this I was ...
0
votes
1answer
22 views

Estimating the mean using Metropolis-Hastings algorithm

When applying the Metropolis-Hastings algorithm, one natural way to compute the mean of the probability distribution at question is averaging over the "results" of each iteration of the ...
1
vote
0answers
86 views

Get random numbers from lists that follow Poisson Distr

I have a simulation that produces each time a list of integers starting from 0 onwards ...
1
vote
1answer
54 views

Monte Carlo Integration Method [closed]

$$q = \int_{-1}^{\infty} xe^{-x-1}\sin{x} \,dx$$ How can I use the Monte Carlo integration method to find out the estimate of q and its standard error, using n iid samples generated from Exp(1) ?
1
vote
2answers
56 views

Calculating an area by using Monte Carlo method

Let B and C be regions in $\mathbb{R}^2$ such that $ B \subset C $. Let's denote their areas $ A(B) \ \mathrm{and} \ A(C)$. We know $A(C)$ but not $A(B)$. We want to find out that area. We know that $$...
2
votes
0answers
40 views

Prove that Monte Carlo integration works

Given N uniform samples $$ \overline{x}_1{,}\ \overline{x}_2{,}\ \dots{,}\ \overline{x}_N \in \Omega ,$$ I am trying to prove that Monte Carlo integration works, so $$ \int_{\Omega}^{ }f\left(\...
0
votes
1answer
27 views

How to obtain the probability density function of a function of random variable?

Assume we have three random variables $x, y, z$, and they follow joint Gaussian distribution. We define $W$ as a new random variable, which is the function of $x, y, z$, denoted as $f(x, y, z)$. The ...
0
votes
0answers
19 views

Different time intervals between drift and diffusion for discretization of Ito process SDE

Here is the background of the question: We all know that, the differential equation of Ito process: $$ dX_t=\mu(t,X_t)dt+\sigma(t,X_t)dW_t $$ can be discretized to the difference form (here we apply ...
0
votes
0answers
9 views

Approximate $\nabla_\theta \int g(f_\theta(x))p(x)\mathrm{d}x$ without having access to $\nabla_y g(y)$

Assume two functions $f_\theta:\mathbb{R}^d\to\mathbb{R^b}$ and $g:\mathbb{R}^b\to\mathbb{R}$, a density function $p$ defined on $\mathbb{R}^d$, where $\theta$ is a vector of parameters (and $f$ is ...
4
votes
1answer
40 views

Generating a 'path' of uniformly distributed continuous random variables

Let $X$, $Y$ be independent continuous random variables both uniformly distributed on $[0,1]$. Is there a function $F(t;X,Y):[0,1]^{\times 3}\rightarrow [0,1]$ satisfying: $F$ is continuous in $t$, ...
0
votes
2answers
34 views

Why is the distribution of values of this random matrix product (seemingly) independent of dimension?

I'm investigating the behavior of the value $|x A y|$ where $x, y \in \mathbb{C}^N$ have unit 2-norm and are uniformly sampled from the unit ball, and $A \in \mathbb{C}^{N \times N}$ has elements ...
0
votes
0answers
29 views

Accept reject sampling for univariate pdf

I am working on generating near uniform samples from an arbitrary univariate truncated pdf (from $[x_1, x_2]$) using Python, the form of the unnormalized pdf is $\sqrt{P(x)}$, where P(x) is a ...
0
votes
1answer
39 views

Conditional Monte Carlo simulation

Suppose random variables $Z_i$ ~ $p(z)$ and $X_i$ ~ $p(x|z)$. $\frac{\sum_{i=1}^n X_i}{n}$ converges to $ E(X)$?
1
vote
0answers
28 views

Monte Carlo and Nearest Neighbor Integral Estimation

Suppose that $f(r,\theta)$ be a 2D probability density function in polar coordinates. How can I estimate the following integral $$I= \int_{\theta_1}^{\theta_2} f(r_0, \theta)g(r_0,\theta) d\theta$$ ...
0
votes
0answers
18 views

Limit of a sum of Van der Corput sequence

I am starting to take interest in Quasi Monte Carlo Methods and I am struggling in the following exercise: image of the exercise The aim of the question is to deduce the value of the following limits: ...
2
votes
0answers
23 views

Monte Carlo simulation for recursive expectation formula

I am using Monte Carlo methods to calculate the following $$ f (t, \lambda) = 1 - {\mathbb E}_{t,\lambda} \left[ \int^T_t f (t, \lambda(s)) \Gamma (\lambda(s), f (s,\lambda(s))) d s \right] , $$ where ...
1
vote
1answer
34 views

Is it possible to get a frequency equation from limited power expansion of differential equation solution?

I have a system of coupled differential equations (an example )in the form of, $ x''+ax'+bx-cy=0$ $ y''-ay'+by-cx=0$ The solution to the above system looks like, $x=Ae^{w_1t}+Be^{w_2t}+Ce^{w_3t}+De^{...
0
votes
0answers
11 views

Do I need to convert a data set into a probability distribution before feeding it into a Monte Carlo simulation?

I want to run a Monte Carlo simulation that, broadly speaking, converts a set of historical values into predicted future values. What is the best way to feed data into the simulation? Do I select ...
-1
votes
1answer
65 views

Estimating the error function using Monte Carlo integration [closed]

How do I perform Monte Carlo integration on the error function $erf(x) = \frac{2}{\sqrt(\pi)}\int_{0}^{x}e^{-t^2}dt$ I have to estimate this using python but I'm not sure how the integral works at all....
2
votes
0answers
80 views

Brownian motion with Karhunen-Loéve expansion

I try to simulate Brownian motion using Karhunen-Loéve expansion in R. I found that formula is: $$W_t=\sqrt2\sum_{k \ge0} \gamma_k\frac{2}{(2k+1)\pi}\sin\bigg(\bigg(k+\frac{1}{2}\bigg)\pi t\bigg)$$ I ...
0
votes
0answers
14 views

What does it mean for the Monte Carlo Tree Search result to converge to the minimax algorithm result?

Consider a perfect information board game, where an outcome can be either a win or a loss. Suppose we try to find the best move using the Monte Carlo Tree Search and after many iterations the ...
2
votes
0answers
23 views

Can I exclude certain “bad” chains in an MCMC sampler? What are the implications?

I am using an ensemble MCMC sampler which samples from the posterior distribution in a Bayesian inversion. The sampler uses $N$ "chains" which all begin from different starting points drawn ...
8
votes
1answer
295 views

Monte-Carlo integration

Let a function $f$ to be $x\in \left[a,b\right],\:0\le f\left(x\right)\le c$. We want to calculate the approximation of the definite integral of the function in the range $[a,b]$, we can suppose that ...

1
2 3 4 5
14