# Questions tagged [monte-carlo]

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

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

### Bootstrap-based robustness of a test checking. Is resampling from sample distribution a good procedure?

I aim to check the robustness of 2 groups t-test when samples come from lightly skewed distributions. To approach the problem I though about performing a Montecarlo based robustness analysis using ...
14 views

### Monte Carlo Gradient Estimation in Auto-encoding Variational Bayes

I am currently reading paper Auto-encoding Variational Bayes and I am not being able to understand the highlighted part in the screenshot below: I am not understanding why there is f(z) and what is ...
• 61
1 vote
45 views

### How to simulate non-gaussian stochastic paths

(Edited to be clearer) I am trying to replicate simulating Geometric Brownian Motion (GBM) but instead of the stochastic increment following a normal distribution, I would like it to follow a ...
• 13
114 views

### Sample uniformly from unit square conditioned on sum and product

Consider the following conditional distributions: \begin{align} X, Y \stackrel{\text{iid}}{\sim} U(0, 1) &\mid X + Y = a & a \in [0, 2] \\ X, Y \stackrel{\text{iid}}{\sim} U(0, 1) &\mid X ...
• 913
1 vote
34 views

### Markov Chain Monte Carlo with known normalisation

I would like to compute the expectation value $\langle O \rangle = \sum_x P(x) O(x)$ of some random variable over an extremely large sample space that I cannot simply exhaustively go through. Usually ...
• 111
I have an $L \times L$ matrix representing a $2D$ region. Each entry of this matrix is a real number lying in the closed interval [0,1]. I want to quantify how different is this from a similar $L \... 5 votes 2 answers 509 views ### Antithetic method for monte carlo when bounds of the integral are infinite I wanted to apply Monte Carlo with antithetic variables to estimate$\int_{0}^{\infty} e^{-x} \,dx$(equal to 1). I used this R code. ... • 53 0 votes 0 answers 27 views ### Alternative to SimPy for continuous event simulation? The python library, SimPy, is pretty explicit that it only handles discrete event simulation. Though it is theoretically possible to do continuous simulations with SimPy, it has no features that help ... • 1,650 -2 votes 1 answer 28 views ### Can you give an example of Metropolis and Metropolis-Hastings algorithm? I have studied many books and tried to understand both the Metropolis and Metropolis-Hastings algorithm. Everywhere it is written in the context of the Ising model or Lenard-Jones Energy. I am having ... • 1,518 2 votes 0 answers 47 views ### Monte Carlo and function minimization (simulated annealing) I posted this question on math.stackexchange, but did not get an answer and a limited amount of views, so I removed the question there and post it here. Recently I was asking myself some basic ... • 653 2 votes 2 answers 186 views ### Markov Chain Monte Carlo doesn't converge I have a synthetic measurement model that looks like this, $$x(t) = e^{j u t \frac{4}{\lambda}},$$$\lambda$is a constant. $$z(t) = x(t) + n(t)$$ The quantity$j = \sqrt{-1}$, the imaginary unit. ... • 73 2 votes 1 answer 23 views ### power analysis via Monte Carlo when effect size, means, and std unknown Say you want to execute an experiment to see whether a treatment is better than a control and want to properly power your experiment. However, you have no beliefs a prior regarding the treatment's ... • 1,650 1 vote 0 answers 39 views ### Hamiltonian Monte Carlo vs. "Metropolis-Hastings with a Hamiltonian step" In Hamiltonian Monte Carlo the proposal is accepted with probability: $$\alpha\left(\mathbf{x}_n(0),\mathbf{x}_n(L\Delta t)\right) = \min\left(1, \frac{\exp\left[-H\left(\mathbf{x}_n(L\Delta t),\... • 1,578 0 votes 0 answers 30 views ### How to identify the distribution being sampled by this algorithm? I've been studying a piece of code lately that uses the Monte Carlo acceptance-rejection method to draw random samples from a distribution I'm struggling to identify. Here's a Python implementation: <... 0 votes 0 answers 48 views ### Non parametric Monte Carlo estimation in R Let's say that we have a dataset of a single vector : ... 0 votes 1 answer 32 views ### When investigating Monte Carlo convergence, should I reuse previous data? I am doing Monte Carlo simulations and I want to investigate the convergence. Two versions come to my mind: 1) Doing every trial independently: For each trial, I generate new data independent from any ... • 203 2 votes 1 answer 81 views ### Monte Carlo in R simulation for Efficiency [closed] An exercise displayed in the image below shows example of finding the efficiency of an estimator. I am trying to replicate this example in R using monte carlo. Y1,Y2,Y3 are random samples of normal ... 1 vote 1 answer 21 views ### Converting fair draws from a PDF into draws from a PDF with a reduced dimensionality Suppose I have N fair samples (x_i, y_i); 1 \leq i \leq N drawn from the 2 dimensional continuous PDF p(x, y); \int p(x, y) \, dx dy = 1. The functional form of p(x, y) is unknown. Is there a ... • 13 0 votes 1 answer 34 views ### Empirical variance of simulation estimate Consider the following quantity of interest:$$I[a,b]=\int_{a}^{b}g(\theta)h(\theta), \ldots (1)$$that is, the expected value of some function h(\theta), of \theta distributed g(\theta). ... 1 vote 0 answers 17 views ### Use of Monte Carlo Tree Search I was talking with someone much more experienced in stats than I am and they suggested the use of Monte Carlo Tree Search for a problem I am facing. Problem Statement: I am collecting jitter ... 0 votes 1 answer 20 views ### Why does rotating Pearson's r in my simulation reduce its MSE? And could you use this with real data to improve MSE? I've been running some Monte Carlo simulations in R to determine the impact on MSE of rotating Pearson's r (the sample statistic, not its data) by itself at various angles, for multiple levels of ... • 110 4 votes 1 answer 45 views ### Monte Carlo Estimates from Different distributions for \theta = \int_{0}^1 \sin(x) dx Monte Carlo Estimates from Different distributions for \theta = \int_{0}^1 \sin(x) dx So I understand that a monte carlo estimate for this integral should look like this \hat\theta = \frac{1}{m} \... 0 votes 1 answer 37 views ### Baffling results in the simulation of a power analysis of a sequential, online A/B experiment I conducted a simulation that had baffling results and would love your help understanding. Context: I want to estimate the required sample size to detect a difference in proportions for a sequential, ... • 113 1 vote 0 answers 24 views ### Hamiltonian trajectory stays in the typical set? I'm currently studying Hamiltonian MCMC by reading Betancourt's 2014 and Neal's 2011 pedagogical papers, but I still don't understand why following a Hamiltonian trajectory for our proposed update ... 1 vote 0 answers 37 views ### Figure of merit for multiple simulations of point patterns I am having problems understanding how I can evaluate a set of (Monte Carlo) simulations based on randomly distributed points. Assume you simulate a random point pattern in a square and you plot the ... • 11 2 votes 1 answer 23 views ### A Monte Carlo simulation of the "winners' curse" in a poorly powered experimental study I am trying to carry out a Monte Carlo simulation that results in N pairings of N p-values from Student's t-test and N values of Cohen's d, such that the resulting vectors of p-values and d-values ... 0 votes 0 answers 36 views ### Finding Monte Carlo estimate \hat{K} using Monte Carlo integration Let$$f\left(x\right)=K\left[sin^2\left(6x\right)+3cos^2\left(x\right)sin^2\left(4x\right)+1\right]e^{-\frac{x^2}{2}},\:-\infty <x<\infty $$be the probability density function of a random ... 0 votes 0 answers 16 views ### Sampling for Approximate Bayesian Computation without Simulation I am trying to use ABC for a physical black box phenomenon. Both the input space and output space are 3D, and there is a proper distance function for the performance space (CIEL*A*B* ΔE). It is not ... 0 votes 0 answers 25 views ### Generate mock data following specific conditions I would like to generate mock stock prices satisfying a certain condition. I define the stock price as a function of time S(t). I can resample the price in a given timeframe such that I can have ... • 213 1 vote 0 answers 28 views ### Variance of samples drawn from different known distributions I have a discrete random variable Z. Every possible outcome of Z has a given probability p(z) and a value given by some normal distribution with unknown mean, but known variance z_i \sim \... • 11 0 votes 1 answer 20 views ### Does values standardization affect its distrution? I have Wald's test results from comparing sensitivity and specificity of LDA and QDA. Results are almost the same. I generate data, train and classify it and then obtain the Wald statistic. I need to ... 0 votes 0 answers 16 views ### Coefficients for higher dimensional NIPC (non intrusive polynomial chaos expansion) heavily biased towards 0 degree function Currently, I am trying to apply the PCE to the thermal fin problem as solved using finite element. Although I cannot attach the code I use, suffice to say I solve a linear system AU=F where F is ... • 111 2 votes 1 answer 96 views ### Is this a reasonable way to determine the reliability of a fit? Background I have measurements of a trajectory that is parameterized by time. The data consists of points with two spacial coordinates (\tilde{x}_i, \tilde{y}_i) and a time stamp (t_i). I'm using <... • 105 1 vote 0 answers 31 views ### Why greedy leads to best among all epsilon-soft Monte Carlo In the RL book of Barto and Sutton, the authors give the definition of epsilon-soft and the pseudocode. I understand this step proves that we can keep improving a epsilon-soft policy. But I don't ... 1 vote 0 answers 73 views ### Monte Carlo integration for a random integrand (or a set of integrand) I understand that the Monte Carlo integration works for a fixed function, say$$\int f(x)p(x)\mathrm{d}x\approx\frac{1}{N}\sum_{i=1}^Nf(X_i),$$where p is a probability density function on sample ... 1 vote 1 answer 44 views ### How to average several posteriors distributions from a Monte Carlo Simulation Say you produce several posteriors distributions from different runs of the same model under different seeds. That is to say you have something like the following: ... • 239 0 votes 0 answers 30 views ### Reward is enough: How can we formulate reinforcement learning as a reward variance reduction technique? Recent paper titled Reward is enough by David Silver and coworkers provide a compelling argument that reward signal has a distinct role in (reinforcement) learning. If we accept, Low-variance on the ... • 1,796 3 votes 0 answers 147 views ### How to calculate the uncertainty of a parameter when using a cost function other than the least squares? Context: Given some measurements y_i associated with the independent variable x and uncertainties \sigma_i and, on the other hand, a model f(x;\theta) where \theta is a free parameter (which ... • 31 1 vote 0 answers 19 views ### Modeling voting paradoxes through Monte Carlo Simulations Recently, I have been reading about voting paradoxes, more specifically the Condorcet paradox which states that there is no majority will. With other words, it may be difficult to aggregate individual ... • 11 1 vote 2 answers 67 views ### Probability game - Simulation don't match the manual solution [closed] Two numbers are bring chosen by random from the set {1,2,3,4,5}. If the sum of the two numbers is even, you win 100 dollars, otherwise you win nothing. In order to participate in the game, you pay 80.... • 418 2 votes 0 answers 95 views ### A generalized randomized mean estimate based on the Chebyshev inequality Let X be a random variable that does not take on a single value with probability 1. Let “black-box" sample access to the random variable X be given. Let M_k be an upper bound on the kth ... • 924 2 votes 1 answer 51 views ### We know that someone identified correctly 3 out of 5 of wines he tasted. How can we answer if he can do that consistently with randomisation testing? [closed] I don't know what should i choose as a control function for that problem. Thanks for your time. 0 votes 0 answers 10 views ### control variate method covariance I was reading in my textbook that the optimal value to minimize variance is equal to c = \frac{Cov(X_i,Y_i)}{Var(Y_i)}. In my particular instance have that X_i = \frac{1}{2+U_i} and Y_i = 2 + U_i... 0 votes 1 answer 197 views ### R Error - Chi-squared approximation may be incorrect I have a dataset with salary information in various companies. I'm testing whether Job Title and Gender are dependent/independent of each other. However I'm running into an approximation error ... 1 vote 1 answer 60 views ### Standard deviation of estimated parameters in Monte carlo simulation I am new to Monte Carlo simulation and have a question. What is the connection between the standard errors of the estimates that we normally get from a regression and standard deviation of sampling ... • 13 0 votes 0 answers 36 views ### Metropolis Hastings on hierarchical bayes update question: [I have this somewhat complicated hierarchical bayesian model]1 Here the y on \theta are Poisson, \theta are deterministically generated from the att, def (and home). Then the last ... 0 votes 0 answers 28 views ### Deriving quantity from two sets of data and do statistical analysis on it? Say I have a factory that produces bottles of salt water, and there are two processes. One adds some water to a bottle and the other adds some salt. I have stats on each process. ie. a sample of how ... • 101 0 votes 0 answers 31 views ### Antithetic variate as control variate to find optimal constant [duplicate] Problem: If \hat{θ}_1 and \hat{θ}_2 are unbiased estimators of θ, and \hat{θ}_1 and \hat{θ}_2 are antithetic, we derived that c^∗ = 1/2 is the optimal constant that minimizes the variance ... • 131 0 votes 1 answer 244 views ### How can you use Envelope Rejection Sampling to generate samples from a posterior distribution? Considering two independent random variables:$$X \sim N(-1, 2^2) \;\; \text{and} \;\;Y \sim N(1, 1^2).$$Assume we cannot observe$X$and$Y$directly but instead observe:$R = \sqrt{X^2 + Y^2} + \...
Say we have two independent variables: $X \sim N(\mu_1, \sigma_1^2)$ and $Y \sim N(\mu_2, \sigma_2^2)$ but these cannot be observed directly. Instead, we can observe $R = \sqrt{X^2 + Y^2} + \epsilon$ ...