# Questions tagged [monte-carlo]

Using (pseudo-)random numbers and the Law of Large Numbers to simulate the random behavior of a real system.

1,154 questions
Filter by
Sorted by
Tagged with
24 views

### mixture of exponential and gamma distribution

I'm not particularly good at statistics and whatever elementary statistics I have had exposure to are now rusty. However, I am working on a problem that I am hoping to gain some insights into: My goal ...
21 views

### Comparing two types of confidence intervals in R using Monte Carlo: trouble understanding what's going on

In a course I'm taking, my professor includes the following code in his slides. I'm trying to understand what this code does, but perhaps more importantly I'm also trying to understand the ...
49 views

### Finding a right way of sampling 1/X knowing X follows the Moschopoulos distribution (sum of Gamma distribution with different (shape/rate parameters)

I can generate, with COGA R library (with rcoga function), a sample from a random variable ...
14 views

### Why set factor means to 0? Monte Carlo simulation

I am using structural equation modeling (SEM). My model is a simple mediation model with latent variables (each latent variable has 3 indicators). I want to run a Monte Carlo simulation to estimate if ...
18 views

### SVM random sampling permutation for imbalanced data: class & score weighted vs non weighted

I have been running the dataset of 2 classes with imbalanced numbers with python. Class one is 61, and class two is 66. When I built up the SVM model and did the random sampling permutation (monte-...
38 views

### Stochastic simulation, what to do after generate the initial random sample

I don't have a background in statistics but currently learning the basics. I want to do a stochastic simulation, which I assume here I should iterate my simulation multiple times. And I am stuck now ...
12 views

26 views

### Importance sampling vs acceptance-rejection [duplicate]

In both importance sampling as well as acceptance-rejection, we sample from some alternate distribution to simulate some expression from an original distribution of which we know the PDF. The ...
17 views

### Could I apply Spatial or simple Dropout before or after Adaptive Average Pooling or Global Average Pooling?

I'm working on a 1D CNN and I want to apply a Monte Carlo Dropout in order to get the mean of the predictions for each instance (as well as the variance, and entropy later on). The network topology ...
26 views

### Computationally + Statistically Efficient Unbiased Estimation of Chebyshev Polynomials of Expectations

Let $T_n$ denote the $n^\text{th}$ Chebyshev polynomial, defined by the recursion \begin{align} T_0(x) &= 1,\\ T_1(x) &= x,\\ T_n(x) &= 2x \cdot T_{n-1} (x) - T_{n-2} (x). \end{align} Now, ...
8 views

### Why does Off-Policy Monte Carlo Control exit when At != pi(St)

I am reading the second edition of Sutton and Barto's "Reinforcement Learning: An Introduction" and confused about the off-policy Monte Carlo part. The MC prediction and control algorithms ...
28 views

### Sampling from bivariate joint cumulative distribution function

Given two variable $x,y$, they are subjected to a joint probability density function: $f(x,y) = \dfrac{1}{3}(3x^2 + 4xy + 3y^2)\\ 0\leq x \leq 1;0\leq y \leq 1$ Obviously, its corresponding ...
75 views

### Distribution of sample p-values with a known true p-value

N. Taleb in his book Statistical Consequences of Fat Tails: Real World Preasymptotics, Epistemology, and Applications (Technical Incerto), page 349 (chapter 19: Meta-distribution of p-values and p-...
22 views

### How to generate uniformly distributed random numbers between 1 and 26 with a dice [duplicate]

I want to generate uniformly distributed random numbers between 1 and 26 with a dice: Is this correct: I have assembled the following algorithm using the Monte Carlo Method: {1, 2, 3, 4, 5, 6} {7, 8, ...
177 views

### Where did I go wrong in computing $P\left(Y-X < \frac{1}{8}\right)$ where $X \sim \mathcal{U}[0,1]$, $Y|X \sim \mathcal{U}[X,1]$?

I'm interested in an adaptation of Problem 1.3 from Mathematical Statistics by S.S. Wilks (second edition, 1962). I've added the self-study tag, however this is for ...
93 views

### How to calculate Quasi-Monte Carlo integration error when sampling with Sobol's sequence?

My understanding is that QMC integration using random sampling will converge with $O(\frac{1}{\sqrt{n}})$, while using Sobol's sampling will converge with $O(\frac{(\log{n})^d}{n})$. However I'm ...
20 views

### Combining importance sampling with enumeration for estimating expected value

I have a Monte Carlo simulation which, given an initial state, does some random stuff and outputs a scalar. Let this output be the random variable $Y$. The simulation takes place on an $K$x$K$ grid, ...
46 views

### Rao-Blackwellization in Black Box VI

In the paper, "Black Box Variational Inference," by Ranganath et al. (2013), the authors derive a Rao-Blackwellized estimator of the gradient of the evidence lower bound with respect to a ...
21 views

### How can I choose the best set of numbers between 1,000 different scenarios?

I run a Monte Carlo simulation that generates more than 1000 different scenarios. For each scenario, I run an optimization algorithm and get the switches' status. The status of switches is 0 (close) ...
20 views

### Notation in Bayesian hierachical models: what does * indicate [closed]

I am new to Bayesian Statistics and have a question about the notation *. What does it indicate in the context of hierarchical models ? Cheers
19 views

633 views

### Estimate the Euler–Mascheroni constant ($\gamma$) by Monte Carlo simulations

The Euler–Mascheroni constant is defined simply as the limiting difference between harmonic series and the natural logarithm. \gamma =\lim_{n\to \infty}\left(\sum _{k=1}^{n}{\frac {1}{k}}-\ln n\...
16 views

### best loss function to fit model if observations contain montecarlo noise?

I have observations on the sphere and I'm trying to fit spherical-harmonic coefficients to best approximate and interpolate the observations. I'm using a solver library for non-linear least squares ...
125 views

### Monte Carlo or other general sampling approaches for conditional distributions?

Suppose we have a sampler – eg a Monte Carlo sampler – for the posterior probability distribution $p(x \vert D)$ of a quantity $x=(y,z)$ consisting of a pair of continuous and multidimensional ...
33 views

### What test to use in order to conclude that a number of seeds/experiments is enough?

When performing a series of replicas for an experiment with a stochastic component (e.g. a Monte Carlo experiment, training a machine learning model, etc.) and averaging the results - how can I ...
18 views

### Probabilistic Bethe Lattice Growth: Bayesian or Markov?

Is the growth of a probabilistic Bethe lattice considered a Markov process or a Bayesian network? Consider a Bethe lattice where the coordination number, z, where z is probabilistic and has maximum ...
73 views

### Monte Carlo simulation for generating random numbers from a distribution [closed]

Describe Monte Carlo simulation technique and mention its different steps. Also describe how would you generate random numbers from Weibull distribution with parameters (θ, β) . In this question, I ...
49 views

### Generating random variable from no closed-form marginal density [closed]

Suppose $u\sim N(0,I_p)$ and $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 ...
25 views

### Generating random variable from mixture representation [duplicate]

Suppose $u\sim N(0,I_p)$ and $Y|U\sim N(x(t),\sigma_e^2I_m)$, and the marginal distribution of $y$ is $f(y)=\int f(y|u)f(u)du$. $x(t)$ is composite function of $u$. The problem is I need to generate ...
36 views

### Von Neumann acceptance-rejection technique for 2 or more variables

I need to generate random numbers that follows a given distribution f(x). Consider the following acceptance-rejection method: I generate two random numbers, $r_1$ and $r_2$, both from 0 to 1 that ...
52 views

### How does Particle Filters work?

I'm trying to figure out how particle filter works. Assume that I have selected propability function called $a \sim Gauss(\mu, \sigma)$. We call it proposial (Gaussian) Distribution. Then we have ...
23 views

### Do I need to know the distribution of the noise before I'm using Monte Carlo Sampling?

I'm going to use Particle Filter, which is a Monte Carlo Sampling. My simple question is: Do I need to know the distribution of the noise before I'm using Monte Carlo Sampling? Or can I just use a ...
17 views

### Integrating Monte Carlo Error Out of Likelihood Function

I am calculating the likelihood for a multivariate normal process in which the conditional mean in computed with Monte Carlo integration. I'm trying to account for the Monte Carlo error within the ...
82 views

### Estimate $E[X_1 | X_1>X_2>\cdots>X_k]$ with simulation

Suppose Random variables $(X_1,X_2,\cdots,X_k)$ are mutually independent, but not identically distributed. I want to estimate $E[X_1|X_1>X_2>\cdots>X_k]$ with simulation. I am wondering if ...
73 views

### How to reproduce the distribution of p-values in a Monte Carlo?

In whichever program (R preferred, but pseudo-code would do), could I get an idea of how Nassim Taleb simulated the distribution of p-values - I guess under the alternative hypothesis - on this MOOC? ...
43 views

### Calculation of Variance from a 2 order Taylor expansion - Expecting a better estimation than with 1st order Taylor expansion

I tried to compute the variance of a squared ratio of 2 Gaussians random variables (not the same means and standard deviations between both). I generate the samples by Monte-Carlo method. I expect ...
15 views

### Why do I get different values for MCSE and SD while I have good estimates in a simulation?

I am a newbie to this concept so I am not sure what exactly is causing this: I am doing a simulation study: 300 samples each which the size of 13000 to compare two estimators for the mean of the ...
260 views

### Trying to calculate confidence intervals for a Monte-Carlo estimate of Pi. What am I doing wrong?

I trying to implement the classic Monte-Carlo simulation of $\pi$ to better understand how confidence intervals (CI) decrease with more trials. There are a lot of examples of how to do the former, but ...
### What are some methods to choose a $n$ for Quasi Monte Carlo Integrations?
When studying "simple" Monte Carlo integration methods, such as Hit or Miss, Crude , Importance Sampling, etc. A common problem for first time learners is to choose a number $n$ of points ...
### Correct methodology using $g$-computation to estimate Average Treatment Effect on the Treated ($ATT$)?
I have a question about the $g$-computation methodology for estimating the Average Treatment Effect on the Treated ($ATT$) in the following article. The authors recommend estimating the $ATT$ by first ...