Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a...
-
Upload
patrick-terry -
Category
Documents
-
view
217 -
download
1
Transcript of Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a...
![Page 1: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/1.jpg)
Montecarlo Simulation
LAB NOV 27 2009
ECON 4550
![Page 2: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/2.jpg)
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
![Page 3: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/3.jpg)
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
![Page 4: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/4.jpg)
Montecarlo Simulations
• We will conduct simple Monte Carlo simulations that will remind us about how the OLS performs
• It is like “test-driving” OLS
![Page 5: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/5.jpg)
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
![Page 6: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/6.jpg)
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
![Page 7: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/7.jpg)
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
![Page 8: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/8.jpg)
Montecarlo Simulations
• Example
• http://shazam.econ.ubc.ca/intro/mcarlo.htm
![Page 9: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/9.jpg)
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
![Page 10: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/10.jpg)
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
![Page 11: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/11.jpg)
Montecarlo Simulations
• We can use a simple OLS regression on the first 40 original observations to obtain:
Yhat = 7.3832 + 0.2323 INCOME
![Page 12: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/12.jpg)
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
![Page 13: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/13.jpg)
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
![Page 14: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/14.jpg)
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
![Page 15: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/15.jpg)
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.
![Page 16: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/16.jpg)
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
![Page 17: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/17.jpg)
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
![Page 18: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/18.jpg)
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
![Page 19: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/19.jpg)
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
![Page 20: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/20.jpg)
Montecarlo Simulations
Repeat the whole exercise for the case of only 200 replications and compare your results
![Page 21: Montecarlo Simulation LAB NOV 27 2009 ECON 4550. Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.](https://reader030.fdocuments.us/reader030/viewer/2022032605/56649e855503460f94b872fd/html5/thumbnails/21.jpg)