1 / 21

Montecarlo Simulation

Montecarlo Simulation. LAB NOV 27 2009 ECON 4550. Montecarlo Simulations. Monte Carlo simulation is a method of analysis based on artificially recreating a chance process (usually with a computer), running it many times, and directly observing the results

moanna
Download Presentation

Montecarlo Simulation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Montecarlo Simulation LAB NOV 27 2009 ECON 4550

  2. Montecarlo Simulations • Monte Carlo simulation is a method of analysis based on artificially recreating a chance process (usually with a computer), running it many times, and directly observing the results • We can use computers to draw large numbers of artificial random samples to evaluate the performance of a variety of sample-based statistics

  3. Montecarlo Simulations • Monte Carlo simulation” is a general term with many meanings • “Simulation” means that we build an artificial model of a real system to study and understand the system • The “Monte Carlo” part of the name comes from the capital of Monaco and reminds us of the randomness inherent in the analysis

  4. Montecarlo Simulations • We will conduct simple Monte Carlo simulations that will remind us about how the OLS performs • It is like “test-driving” OLS

  5. Montecarlo Simulations • For example, in the single regression model, the parameter of interest is usually the slope parameter • If the errors have zero mean, the explanatory variable is non-random and the model is correctly specified, the OLS estimator is an unbiased estimator of the slope parameter, which means that on average it will be equal to the parameter

  6. Montecarlo Simulations • If, additionally, the errors are normally distributed, the OLS estimator has a normal distribution • With one given sample of observations from the population, OLS can be applied to obtain one estimate of the slope parameter • That OLS estimate will be smaller or larger than the true parameter • However, if estimates were obtained from a "large" number of random samples then the average estimate over all samples would equal the true parameter value

  7. Montecarlo Simulations • The above ideas can be illustrated with the help of computer simulation • Repeated samples of data can be generated by artificially generating errors that follow a given distribution • The properties of the OLS estimation rule can then be analyzed

  8. Montecarlo Simulations • Example • http://shazam.econ.ubc.ca/intro/mcarlo.htm

  9. Montecarlo Simulations • Example • http://shazam.econ.ubc.ca/intro/mcarlo.htm • Using an amplified version of the dataset GHJ160.txt • It contains data on food expenditures and income

  10. Montecarlo Simulations • Example • http://shazam.econ.ubc.ca/intro/mcarlo.htm • Using an amplified version of the dataset GHJ160.txt • It contains data on food expenditures and income

  11. Montecarlo Simulations • We can use a simple OLS regression on the first 40 original observations to obtain: Yhat = 7.3832 + 0.2323 INCOME

  12. Montecarlo Simulations • However, we will now assume that these results are not merely estimates but rather describe the true (usually deemed unobservable) model for household expenditure on food • That is, let us assume that the true linear regression model is: Y = 7.3832 + 0.2323 INCOME + e

  13. Montecarlo Simulations • The first order of business would be to say something about the error e • We can assume it is distributed normally and homoskedastically • We can find out from the original OLS regression its estimated variance

  14. Montecarlo Simulations • Now we assume that that estimated variance is actually the one driving the real process in the population • That variance is 46.853, which you can obtain from SHAZAM

  15. Montecarlo Simulations For a sample size of N=40 : • Use a random number generator to generate a sample of independent and identically distributed errors with mean zero and variance 46.853 • The NOR function on the GENR command is used to generate normal random numbers.

  16. Montecarlo Simulations For a sample size of N=40 : • Calculate sample observations for the variable Y where INCOME is fixed • Run OLS to obtain estimates of the intercept parameter and the slope parameter

  17. Montecarlo Simulations For a sample size of N=40 : • The above steps are repeated. At each replication a different set of expenditures Y is computed • The number of replications is first set at 1000 • The experiment then yields 1000 estimates of the slope parameter using a sample size of N=40 • The sampling variability in the estimates can be summarized by plotting the empirical frequency distribution of the estimates in an histogram

  18. Montecarlo Simulations For a sample size of N=80 : • The above steps are repeated. At each replication a different set of expenditures Y is computed • The number of replications is first set at 1000 • The experiment then yields 1000 estimates of the slope parameter using a sample size of N=80 • The sampling variability in the new set of estimates can be summarized by plotting the empirical frequency distribution of the estimates in an histogram

  19. Montecarlo Simulations For a sample size of N=160 : • The above steps are repeated. At each replication a different set of expenditures Y is computed • The number of replications is first set at 1000 • The experiment then yields 1000 estimates of the slope parameter using a sample size of N=160 • The sampling variability in the new set of estimates can be summarized by plotting the empirical frequency distribution of the estimates in an histogram

  20. Montecarlo Simulations Repeat the whole exercise for the case of only 200 replications and compare your results

More Related