How To Calculate Monte Carlo Standard Error
Contents |
Pseudo-failures to replicate » Markov chain Monte Carlo standard errors Posted byAndrew on 2 April 2007, 12:36 am Galin Jones sent me this paper (by James Flegal, Murali Haran, and himself) standard error of monte carlo simulation which he said started with a suggestion I once made to him
Monte Carlo Standard Error Definition
long ago. That's pretty cool! Here's the abstract: Current reporting of results based on Markov chain Monte Carlo computations
What Is Monte Carlo Error
could be improved. In particular, a measure of the accuracy of the resulting estimates is rarely reported in the literature. Thus the reader has little ability to objectively assess the
Monte Carlo Error Analysis
quality of the reported estimates. This paper is an attempt to address this issue in that we discuss why Monte Carlo standard errors are important, how they can be easily calculated in Markov chain Monte Carlo and how they can be used to decide when to stop the simulation. We compare their use to a popular alternative in the context of two monte carlo error definition examples. This is a clear paper with some interesting results. My main suggestion is to distinguish two goals: estimating a parameter in a model and estimating an expectation. To use Bayesian notation, if we have simulations theta_1,…,theta_L from a posterior distribution p(theta|y), the two goals are estimating theta or estimating E(theta|y). (Assume for simplicity here that theta is a scalar, or a scalar summary of a vector parameter.) Inference for theta or inference for E(theta) When the goal is to estimate theta, then all you really need is to estimate theta to more accuracy than its standard error (in Bayesian terms, its posterior standard deviation). For example, if a parameter is estimated at 3.5 +/- 1.2, that's fine. There's no point in knowing that the posterior mean is 3.538. To put it another way, as we draw more simulations, we can estimate that "3.538" more precisely-our standard error on E(theta|y) will approach zero-but that 1.2 ain't going down much. The standard error on theta (that is, sd(theta|y)) is what it is. This is a general issue in simulation (not just using Markov chains),
for indirect effects? This page shows simulation standard error how to obtain Monte Carlo standard errors and confidence intervals monte carlo integration error for indirect effects in a mediation analysis. We will illustrate the process using the monte carlo standard error of the mean hsbdemo dataset. For our example, science will act as the dependent variable, math as the independent variable and read as the mediator variable. http://andrewgelman.com/2007/04/02/markov_chain_mo/ We make no claims that this a good example of a mediation model. We only use it to illustrate the steps involved. We will begin by reading in the data and using the sureg command to generate the values we will use to compute the indirect effect as http://www.ats.ucla.edu/stat/stata/faq/mc_se.htm the product of coefficients. use http://www.ats.ucla.edu/stat/data/hsbdemo, clear (highschool and beyond (200 cases)) sureg (read math)(science read math) Seemingly unrelated regression ---------------------------------------------------------------------- Equation Obs Parms RMSE "R-sq" chi2 P ---------------------------------------------------------------------- read 200 1 7.662848 0.4386 156.26 0.0000 science 200 2 7.133989 0.4782 183.30 0.0000 ---------------------------------------------------------------------- ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- read | math | .724807 .0579824 12.50 0.000 .6111636 .8384504 _cons | 14.07254 3.100201 4.54 0.000 7.996255 20.14882 -------------+---------------------------------------------------------------- science | read | .3654205 .0658305 5.55 0.000 .2363951 .4944459 math | .4017207 .0720457 5.58 0.000 .2605138 .5429276 _cons | 11.6155 3.031268 3.83 0.000 5.674324 17.55668 ------------------------------------------------------------------------------ One method of computing the indirect effect, standard error and confidence interval is to use the nlcom command.nlcom _b[read:math]*_b[science:read] _nl_1: _b[read:math]*_b[science:read] ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _nl_1 | .2648593 .0522072 5.07 0.000 .162
be down. Please try the request again. Your cache administrator is webmaster. Generated Mon, 17 Oct 2016 16:04:48 GMT by s_ac15 (squid/3.5.20)
be down. Please try the request again. Your cache administrator is webmaster. Generated Mon, 17 Oct 2016 16:04:48 GMT by s_ac15 (squid/3.5.20)