You are on page 1of 2

How to set up a Monte Carlo simulation: The general idea Here is the general idea of Monte Carlo simulation

(but of course this could be modified in many different ways): T = number of simulations (replications) n = sample size of data X = data fi ed throughout the Monte Carlo! X is an n " matri #n obser$ations and " independent $ariables (including the intercept) true%betas = true $alue of the coefficients on the X $ariables!

Then& for each of the T simulations (let's say T=()&)))) you would do the following *enerate epsilon according to some specified process! +ou can generate epsilon using an ,-CH framewor"& or epsilon might comes from a standard normal distribution& a mi ture of normal distributions (which means it the epsilons ha$e a thic".tailed distribution)& a lognormal distribution (which means the epsilons ha$e a s"ewed distribution)& or it may be a different process entirely! /nce you ha$e generated an n ( $ector of epsilons& you 0create1 + as + = X2true%betas 3 epsilon 4ow you ha$e + and X and you can estimate the betas from the model + = X2beta%hat +ou will estimate this beta%hat $ector using se$eral methods! 5or e ample& you might estimate beta%hat using /67& *MM& and 8M69 (perhaps with the 7*T& the :H7& and the g.and.h distributions)! 7o now you ha$e estimated beta%hat for a particular + and X using se$eral different techni;ues!

-

4e t& you will repeat the same process as abo$e using a different random $ector of epsilons! The epsilons will be generated using the same process& but they will be a different set of random numbers! ,fter estimating& you now ha$e another set of beta%hats for each estimation techni;ue! +ou could repeat the abo$e process for a different type of random error! 5or e ample& you might do the whole ()&))) simulations for normal errors& lognormal errors& and mi ed normal errors! /nce you ha$e finished all of the simulations& you can use your estimates of beta%hat to determine characteristics about the estimation techni;ues!

6et beta%( represent the first element of the beta%hat $ector after the intercept coefficient (in other words& the first slope parameter or the coefficient on the $ariable %()! 4ote that you ha$e& for a particular type of error distribution (let's say normal errors)& ()&))) estimates of beta%( for each estimation techni;ue! 4ote also that you "now the true value of beta%( because it is contained in the true%betas $ector which stayed fi ed the whole time! 7o for each estimation techni;ue you can ta"e those ()&))) estimates of beta%( (call this $ector <9T,%H,T) and calculate the bias of each estimation techni;ue: <ias = mean(<9T,%H,T) = true%beta%(> ,nd you can compare the <ias of one estimation techni;ue with another! +ou could also calculate the root mean s;uared error (-M79): -M79 = s;rt(mean((<9T,%H,T = true%beta%()!?@)) There you ha$e it! That is the general idea behind Monte Carlo simulations!