Questions tagged [monte-carlo]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
21 views

Expected value with dependent samples

It is well known that the expected value of a function can be approximated with i.i.d. samples: $$ E_X[f(X)] = \frac{1}{n}\sum_{i=1}^n f(x_i),\quad x_i\sim_{i.i.d.} X $$ What methods exist to ...
1
vote
1answer
21 views

Standard deviation in Direct-Sampling

In a computational physics course, I was asked to do direct-sampling for the numerical value of $\pi$ and then I estimated the standard deviation of $\pi$ , ...
0
votes
0answers
32 views

How to generate data with given correlation, one distribution counting intergers, the other normal?

I would like to do a Monte Carlo simulation related to this post: How to predict the degree to which an extraneous variable will attenuate a correlation? I need to generate a dataset with a Pearson r ...
1
vote
0answers
20 views

Confusion in Sampling using the IP algorithm (Bishop PRML)

I'm reading Bishop's PRML p. 537 and I don't understand one piece of the IP (data augmentation) algorithm. Namely, the part that says "we use the samples $\{\mathbf{Z}^{(l)}\}$ obtained in the I step ...
0
votes
0answers
18 views

2-dimensional inverse transform sampling [closed]

Let $M\subseteq\mathbb R^3$ be a disjoint union of orientable surfaces. In Monte Carlo ray tracing, we sample a surface point $p'\in M$ by drawing a random direction $\omega_{\rm i}\in S^2$ on the ...
1
vote
1answer
30 views

Sampling from unknown probability distribution [duplicate]

I'm reading about Monte Carlo methods. Suppose that $X_1,...,X_n$ are i.i.d $p(x_i|\theta)$, where $\theta$ is an unknown parameter of interest. My textbook states: Suppose we could sample some number ...
0
votes
0answers
15 views

Use of the inversion method in sequential sampling to “invert” a random walk

Let $M\subseteq\mathbb R^3$ be Borel measurable, $\lambda$ be a $\sigma$-finite measure on $\mathcal B(M)$, $k\in\mathbb N$, $I:=\{0,\ldots,k\}$, $q$ be a probability density on $\left(E^I,{\mathcal E}...
0
votes
0answers
26 views

Issue about confidence interval on OLS intercept

Let us assume this simple linear model: $Y|X=\beta_0+\beta_1X+\epsilon $ where $X \sim N(\mu,\sigma^2)$ and $\epsilon \sim N(0,\sigma_{\epsilon}^2)$ Suppose also that $X$ and $\epsilon$ have all ...
1
vote
1answer
32 views

Hamiltonian Monte Carlo with distributions on the unit sphere (Von Mises Fisher distribution)

Hamiltonian Monte Carlo (HMC) seems like a powerful technique for sampling from probability distributions. However it seems that for it to be applicable, the parameter space has to be 'unconstrained', ...
1
vote
0answers
29 views

Why the Monte Carlo Control algorithm is written this way?

I am having trouble to understand this algorithm, since this is not how I would have written it. To me, we should first start to fix a policy. Then, we evaluate the Q values associated with this ...
1
vote
1answer
31 views

Estimate default by importance sampling (using R)

I want to use Importance sampling to estimate probability of default of an insurance company within the next $t$ years. The company starts with capital $C$ at $t=0$. Each year it gains $p > 0$ ...
11
votes
2answers
838 views

Why does thinning work in Bayesian inference?

In Bayesian inference, one needs to determine the posterior distribution of the parameters from the prior distribution and the likelihood of the data. As this computation might not be possible ...
1
vote
0answers
217 views

Modeling bivariate beta distributions in PyMC3

My goal is to perform a bayesian A/B test of probabilities of success in two groups considering a hypothesis about non-zero covariance between those probabilities. Bivariate beta distribution I am ...
5
votes
0answers
48 views

Keeping track of the variance of a Metropolis-Hastings estimator

Let $(E,\mathcal E,\lambda)$ and $(E',\mathcal E',\lambda')$ be measure spaces, $p,q$ be probability densities on $(E,\mathcal E,\lambda)$, and $\varphi:E'\to E$ be bijective and $(\mathcal E',\...
1
vote
1answer
44 views

Simulating Laplace's needle to estimate $\pi$

A recent question sought assistance with computer simulation of Buffon's needle problem in R, with the goal of obtaining a Monte Carlo estimate of $\pi$. This is ...
0
votes
0answers
15 views

Validity of Monte-Carlo method to estimate a probability distribution which follows a power law

I am using a Monte-Carlo method to estimate a probability distribution function (pdf). Basically, I have several input parameters following known distributions, from which I can draw samples, that I ...
1
vote
0answers
29 views

Stratified sampling to generate random numbers (eg. for Monte-Carlo applications)

I am using a Monte-Carlo method to compute a value of interest $y$ from some input parameters $x_{i}$, that I use to draw statistical sets from simple distribution laws. In my case, for a single Monte-...
0
votes
0answers
39 views

Minimizer of $\int\mu({\rm d}x)\int\kappa(x,{\rm d}y)|g(x)-g(y)|^2$ for a jump kernel $\kappa$ of the Metropolis-Hastings algorithm

Let $\kappa$ be a sub-Markov kernel on a measurable space $(E,\mathcal E)$ and $\mu$ be a probability measure on $(E,\mathcal E)$ reversible with respect to $\kappa$. Assume $\kappa$ and $\mu$ admit a ...
6
votes
3answers
879 views

What's the advantage of importance sampling? [closed]

Here is a nice example of importance sampling: ...
0
votes
1answer
70 views

Monte Carlo Sampling is performing better then Bayesian Optimization

So I am testing the Bayesian optimization library for determining where to sample next by quering a test function such as 2d Rosenbrock to better reconstruct that function using Gaussian Process ...
0
votes
0answers
26 views

assessing the stability of importance (sampling) weights

I have read that when importance weights are used, the stability (variability) of the weights should be assessed (Levine and Casella, 2001) -- however, I wonder how this might be accomplished. For ...
0
votes
1answer
44 views

Monte Carlo simulation to generate random numbers from Pareto distribution

I am trying to generate random numbers using Monte Carlo simulation from Pareto distribution using R. But I am not able to find the codes for the same. It would be very helpful if someone could share ...
0
votes
0answers
18 views

Can we use a Dirac kernel in the proposal of the Metropolis-Hastings algorithm?

I'm running the Metropolis-Hastings algorithm on a product space $(I\times E,2^I\otimes\mathcal E,\zeta\otimes\lambda)$, where $I$ is a finite nonempty set and $\zeta$ denotes the counting measure. ...
2
votes
0answers
18 views

How to Simulate Pure-Jump Process associated Marked Point Process in R

Fix $M>0$ and let $(\tau_i,\zeta_i)_{i =1}^{\infty}$ be a marked point process associated to the poisson-random measure $\mu$ on $[0,1]\times [-M,M]^2\times [0,M]\times [-M,M]$ with uniform finite-...
0
votes
0answers
17 views

Use both historical prices and fundamentals data for predicting portfolio profit?

Get highly accurate probability distribution for the future price of portfolio using all the data available. Each stock has two historical data - daily prices (scalar time series updated daily) and ...
0
votes
1answer
54 views

Data generation process from an given regression model and monte-carlo experiment in R

I want to generate data in R to solve the following problem: Consider the following Data Generating Process (DGP) $Y_i = β_0 + β_1 · X_i + β_2 · Z_i + u_i$ , where $β_0 = 0.75$, $β_1 = 0.50$ and $β_2 ...
1
vote
0answers
16 views

Robust sum of non-independent random variables

What approach could be used to sum non-independent variables? I have probability distributions of stock prices and want to calculate the probability distribution of the portfolio price (sum of some ...
0
votes
0answers
16 views

Difference between cross-validation, backtesting, historical simulation, Monte Carlo simulation, bootstrap replication?

In finance, to determine if a trading strategy is better than others, or to optimize the parameters of a model, the following statistical techniques are often employed, often one over the others ...
0
votes
1answer
13 views

MCMC Metropolis-Hastings Understanding [closed]

I am having trouble understanding a key aspect of MCMC - does the collection of states the Markov chain passes through represent the target distribution, or for a single sample, are we running $n$ ...
0
votes
1answer
25 views

Using a sample obtained via McMc for Monte Carlo

Suppose we have a sample obtained via McMc. In order to use this sample for Monte-Carlo we need the sample to be independent. However our sample obtained via McMc is not independent, how can we ...
2
votes
0answers
15 views

How to account for Covariances in a Monte Carlo simulation?

I am conducting a regression analysis of Z on X and Y. I am interesting in interpreting the marginal effect. The model includes quadratic terms for both X and Y as well as an interaction term X*Y. If ...
2
votes
1answer
22 views

For Hamiltonian Monte Carlo, what should be done when one of the steps in the leapfrog path yields no solution?

When estimating a very complex (potentially discontinuous) model with Hamiltonian Monte Carlo, what should be done when one of the steps in the leapfrog path yields no solution? The issue is that ...
2
votes
0answers
30 views

How to do power analysis for Fisher exact test in tables larger than 2x2? [duplicate]

I have 4x2 contingency tables and would like to perform Fisher's exact test on them. R stats package(https://www.rdocumentation.org/packages/stats/versions/3.6.1/topics/fisher.test) supports 4x2 test ...
1
vote
0answers
23 views

How to compare SEM estimation methods in R? [closed]

I would like to use several estimators in SEM (e.g. ML vs Yuan-Bentler vs DWLS) and then by using Monte-Carlo approach compare: (a) average relative bias of the estimators, (b) average relative ...
1
vote
2answers
55 views

Evaluate an integral using importance sampling

Estimate $\int^{1}_{0}e^{x} dx$ using importance sampling. Should I use beta distribution as proposal distribution and uniform distribution as target ?
0
votes
0answers
15 views

Assess identical distribution of measurements from a time series

Suppose we are given a time series $(X_1,\dots,X_N)$. How would one assess that the $X_i$'s come from the same distribution? Imagine $N$ is very large. Now let $n<<N$ and suppose we perform the ...
0
votes
0answers
26 views

How to create a data analysis template (lavaan parameter table) using simsem package R?

I am unfamiliar with simsem package for SEM simulations, and would like some help with it. I would like to create a data analysis template (lavaan parameter table) ...
2
votes
0answers
35 views

Better estimator of the mean of a distribution

Suppose $X_1$, . . . , $X_n$ iid∼ F and $Y_1$, . . . , $Y_n$ is a Markov chain with F as the stationary distribution. Consider two estimates of the mean of F: $X_m$ $=$ $\frac{1}{n}$$\sum_{i=1}^n X_i$...
2
votes
1answer
53 views

Any examples of Monte-Carlo analysis in R for sample size calculations for SEM?

I would like to calculate required sample size for my SEM model to achieve the power of at least 0.8. I read some articles that recommend using Monte-Carlo analysis in order to determine the sample ...
1
vote
0answers
9 views

Are subsequences of low discrepancy sequence also low discrepancy? [closed]

Given a low discrepancy sequence x1 ... xN, lets say I randomly select a subsequence x100 ... x200, will this subsequence have low discrepancy? Will those points "fill" up the space uniformly? If not ...
0
votes
0answers
19 views

How to understand 4 steps of Monte Carlo tree search?

From many blogs and this one https://web.archive.org/web/20160308070346/http://mcts.ai/about/index.html We know that the process of MCTS algorithm has 4 steps. Selection: Starting at root node R,...
2
votes
1answer
28 views

MCMC standard error when there is no CLT?

Suppose we use MCMC to estimate: $$ \mathbf{E}_\pi (h) \approx \frac{1}{N}\sum_{i=1}^{N} h(X_i) $$ If a Markov chain is geometrically ergodic and there is some $ \delta > 0 $ such that $ \mathbf{...
1
vote
0answers
23 views

ABC SMC: How do weights scale proportionally with number of parameters

Having some problems with the ABC SMC algorithm. I'm trying to implement the methods taken from here: Simulation-based model selection for dynamical systems in systems and population biology How do ...
0
votes
0answers
38 views

How to calculate the PDF of the 'difference' between two Beta distributions?

I start with two Beta distributions: $$\mathrm{Beta_A}(p; \alpha_A, \beta_A) = \frac{p^{\alpha_A-1}\,(1-p)^{\beta_A-1}}{\mathrm{B}(\alpha_A, \beta_A)}$$ $$\mathrm{Beta_B}(p; \alpha_B, \beta_B) = \...
0
votes
1answer
28 views

Do I want pnorm or one sample t-test?

I have an algorithm that calculates a metric from my real data, I have a simulation that generates random data of the same type and dimensions, runs the algorithm, and produces the same metric once ...
0
votes
0answers
17 views

Kalman Filter and Monte Carlo

What is the consequence on the uncertainty of our estimate when applying the standard kalman filter to nonlinear systems? If we are unaware of the functional form of these non linear systems how do ...
7
votes
2answers
101 views

What is better in Monte Carlo integration: product of means or mean of products?

Let $X$ and $Y$ be two independent continuous random variables with pdfs $f_X$ and $f_Y$, respectively. Let $\varphi_1$ and $\varphi_2$ be two continuous functions from ${\mathbb R}$ to ${\mathbb R}$. ...
1
vote
0answers
20 views

Propogating Standard Error through monte carlo? [closed]

I have a model that has a bunch of parameters that I experimentally determined the mean and accompanying standard error/STD. Because the model has some tricky terms in it I'd like to propagate the ...
1
vote
0answers
66 views

Why do we use the log-derivative trick before Monte Carlo?

I still don't understand how we can approximate the gradient of an expected value... Indeed it's impossible to sample points and then to average the gradients of them as we have only samples... (How ...
1
vote
0answers
20 views

How to use Hamiltonian Monte Carlo when some parameters result in ill-defined likelihoods?

I want to use Hamiltonian Monte Carlo for an estimation problem where, for some parameters, the solution does not "make sense," so I cannot compute the log likelihood or its gradient. In addition, I ...