Download presentation

Presentation is loading. Please wait.

Published byGarett Storrs Modified about 1 year ago

1
Christopher Dougherty EC220 - Introduction to econometrics (chapter 2) Slideshow: a Monte Carlo experiment Original citation: Dougherty, C. (2012) EC220 - Introduction to econometrics (chapter 2). [Teaching Resource] © 2012 The Author This version available at: http://learningresources.lse.ac.uk/128/http://learningresources.lse.ac.uk/128/ Available in LSE Learning Resources Online: May 2012 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. This license allows the user to remix, tweak, and build upon the work even for commercial purposes, as long as the user credits the author and licenses their new creations under the identical terms. http://creativecommons.org/licenses/by-sa/3.0/ http://creativecommons.org/licenses/by-sa/3.0/ http://learningresources.lse.ac.uk/

2
1 A MONTE CARLO EXPERIMENT True model: Fitted line: In the previous slideshow, we saw that the error term is responsible for the variations of b 2 around its fixed component 2. We demonstrated mathematically that the expectation of the error term is zero and hence that b 2 is an unbiased estimator of 2.

3
2 A MONTE CARLO EXPERIMENT In this slideshow we will investigate the effect of the error term on b 2 directly, using a Monte Carlo experiment (simulation). True model: Fitted line:

4
3 Choose model in which Y is determined by X, parameter values, and u Choose data for X Choose parameter values Choose distribution for u Model Generate the values of Y A MONTE CARLO EXPERIMENT A Monte Carlo experiment is a laboratory-style exercise usually undertaken with the objective of evaluating the properties of regression estimators under controlled conditions.

5
4 Choose model in which Y is determined by X, parameter values, and u Choose data for X Choose parameter values Choose distribution for u Model Generate the values of Y A MONTE CARLO EXPERIMENT We will use one to investigate the behavior of OLS regression coefficients when applied to a simple regression model.

6
5 Choose model in which Y is determined by X, parameter values, and u Choose data for X Choose parameter values Choose distribution for u Model Generate the values of Y A MONTE CARLO EXPERIMENT We will assume that Y is determined by a variable X and a disturbance term u, we will choose the data for X, and we will choose values for the parameters.

7
6 Choose model in which Y is determined by X, parameter values, and u Choose data for X Choose parameter values Choose distribution for u Model Generate the values of Y A MONTE CARLO EXPERIMENT We will also generate values for the disturbance term randomly from a known distribution.

8
7 Choose model in which Y is determined by X, parameter values, and u Choose data for X Choose parameter values Choose distribution for u Model Generate the values of Y A MONTE CARLO EXPERIMENT The values of Y in the sample will be determined by the values of X, the parameters and the values of the disturbance term.

9
8 Choose model in which Y is determined by X, parameter values, and u Choose data for X Choose parameter values Choose distribution for u Model Generate the values of Y Estimators Estimate the values of the parameters A MONTE CARLO EXPERIMENT We will then use the regression technique to obtain estimates of the parameters using only the data on Y and X.

10
9 Choose model in which Y is determined by X, parameter values, and u Choose data for X Choose parameter values Choose distribution for u Model Generate the values of Y Estimators Estimate the values of the parameters A MONTE CARLO EXPERIMENT We can repeat the process indefinitely keeping the same data for X and the same values of the parameters but using new randomly-generated values for the disturbance term.

11
10 Choose model in which Y is determined by X, parameter values, and u Choose data for X Choose parameter values Choose distribution for u Model Generate the values of Y Estimators Estimate the values of the parameters A MONTE CARLO EXPERIMENT In this way we can derive probability distributions for the regression estimators which allow us, for example, to check up on whether they are biased or unbiased.

12
11 Choose model in which Y is determined by X, parameter values, and u Choose data for X Choose parameter values Choose distribution for u Model Generate the values of Y Estimators Estimate the values of the parameters Y = 1 + 2 X + u X = 1, 2,..., 20 1 = 2.0 2 = 0.5 u is independent N(0,1) Y = 2.0 + 0.5X + u Generate the values of Y A MONTE CARLO EXPERIMENT In this experiment we have 20 observations in the sample. X takes the values 1, 2,..., 20. 1 is equal to 2.0 and 2 is equal to 0.5.

13
12 Choose model in which Y is determined by X, parameter values, and u Choose data for X Choose parameter values Choose distribution for u Model Generate the values of Y Estimators Estimate the values of the parameters Y = 1 + 2 X + u X = 1, 2,..., 20 1 = 2.0 2 = 0.5 u is independent N(0,1) Y = 2.0 + 0.5X + u Generate the values of Y A MONTE CARLO EXPERIMENT The disturbance term is generated randomly using a normal distribution with zero mean and unit variance. Hence we generate the values of Y.

14
13 We will then regress Y on X using the OLS estimation technique and see how well our estimates b 1 and b 2 correspond to the true values 1 and 2. Choose model in which Y is determined by X, parameter values, and u Choose data for X Choose parameter values Choose distribution for u Model Generate the values of Y Estimators Estimate the values of the parameters Y = 1 + 2 X + u X = 1, 2,..., 20 1 = 2.0 2 = 0.5 u is independent N(0,1) Y = 2.0 + 0.5X + u Generate the values of Y Estimate the values of the parameters A MONTE CARLO EXPERIMENT

15
Y = 2.0 + 0.5X + u Here are the values of X, chosen quite arbitrarily. 14 X2.0+0.5X u YX 2.0+0.5X u Y 12.5–0.591.91117.51.599.09 23.0–0.242.76128.0–0.927.08 33.5–0.832.67138.5–0.717.79 44.00.034.03149.0–0.258.75 54.5–0.384.12159.51.6911.19 65.0–2.192.811610.00.1510.15 75.51.036.531710.50.0210.52 86.00.246.241811.0–0.1110.89 96.52.539.031911.5–0.9110.59 107.0–0.136.872012.01.4213.42 A MONTE CARLO EXPERIMENT

16
Y = 2.0 + 0.5X + u Given our choice of numbers for 1 and 2, we can derive the nonstochastic component of Y. 15 X2.0+0.5X u YX 2.0+0.5X u Y 12.5–0.591.91117.51.599.09 23.0–0.242.76128.0–0.927.08 33.5–0.832.67138.5–0.717.79 44.00.034.03149.0–0.258.75 54.5–0.384.12159.51.6911.19 65.0–2.192.811610.00.1510.15 75.51.036.531710.50.0210.52 86.00.246.241811.0–0.1110.89 96.52.539.031911.5–0.9110.59 107.0–0.136.872012.01.4213.42 A MONTE CARLO EXPERIMENT

17
The nonstochastic component is displayed graphically. 16 A MONTE CARLO EXPERIMENT

18
Y = 2.0 + 0.5X + u Next, we generate randomly a value of the disturbance term for each observation using a N(0,1) distribution (normal with zero mean and unit variance). 17 X2.0+0.5X u YX 2.0+0.5X u Y 12.5–0.591.91117.51.599.09 23.0–0.242.76128.0–0.927.08 33.5–0.832.67138.5–0.717.79 44.00.034.03149.0–0.258.75 54.5–0.384.12159.51.6911.19 65.0–2.192.811610.00.1510.15 75.51.036.531710.50.0210.52 86.00.246.241811.0–0.1110.89 96.52.539.031911.5–0.9110.59 107.0–0.136.872012.01.4213.42 A MONTE CARLO EXPERIMENT

19
Y = 2.0 + 0.5X + u Thus, for example, the value of Y in the first observation is 1.91, not 2.50. 18 X2.0+0.5X u YX 2.0+0.5X u Y 12.5–0.591.91117.51.599.09 23.0–0.242.76128.0–0.927.08 33.5–0.832.67138.5–0.717.79 44.00.034.03149.0–0.258.75 54.5–0.384.12159.51.6911.19 65.0–2.192.811610.00.1510.15 75.51.036.531710.50.0210.52 86.00.246.241811.0–0.1110.89 96.52.539.031911.5–0.9110.59 107.0–0.136.872012.01.4213.42 A MONTE CARLO EXPERIMENT

20
19 Similarly, we generate values of Y for the other 19 observations. Y = 2.0 + 0.5X + u X2.0+0.5X u YX 2.0+0.5X u Y 12.5–0.591.91117.51.599.09 23.0–0.242.76128.0–0.927.08 33.5–0.832.67138.5–0.717.79 44.00.034.03149.0–0.258.75 54.5–0.384.12159.51.6911.19 65.0–2.192.811610.00.1510.15 75.51.036.531710.50.0210.52 86.00.246.241811.0–0.1110.89 96.52.539.031911.5–0.9110.59 107.0–0.136.872012.01.4213.42 A MONTE CARLO EXPERIMENT

21
The 20 observations are displayed graphically. 20 A MONTE CARLO EXPERIMENT

22
We have reached this point in the Monte Carlo experiment. 21 A MONTE CARLO EXPERIMENT Choose model in which Y is determined by X, parameter values, and u Choose data for X Choose parameter values Choose distribution for u Model Generate the values of Y Estimators Estimate the values of the parameters Y = 1 + 2 X + u X = 1, 2,..., 20 1 = 2.0 2 = 0.5 u is independent N(0,1) Y = 2.0 + 0.5X + u Generate the values of Y

23
We will now apply the OLS estimators for b 1 and b 2 to the data for X and Y, and see how well the estimates correspond to the true values. 22 A MONTE CARLO EXPERIMENT Choose model in which Y is determined by X, parameter values, and u Choose data for X Choose parameter values Choose distribution for u Model Generate the values of Y Estimators Estimate the values of the parameters Y = 1 + 2 X + u X = 1, 2,..., 20 1 = 2.0 2 = 0.5 u is independent N(0,1) Y = 2.0 + 0.5X + u Generate the values of Y Estimate the values of the parameters

24
Here is the scatter diagram again. 23 A MONTE CARLO EXPERIMENT

25
The regression estimators use only the observed data for X and Y. 24 A MONTE CARLO EXPERIMENT

26
Here is the regression equation fitted to the data. 25 A MONTE CARLO EXPERIMENT

27
For comparison, the nonstochastic component of the true relationship is also displayed. 2 (true value 0.50) has been overestimated and 1 (true value 2.00) has been underestimated. 26 A MONTE CARLO EXPERIMENT

28
We will repeat the process, starting with the same nonstochastic components of Y. 27 A MONTE CARLO EXPERIMENT

29
As before, the values of Y are modified by adding randomly-generated values of the disturbance term. 28 A MONTE CARLO EXPERIMENT

30
The new values of the disturbance term are drawn from the same N(0,1) distribution as the previous ones but, except by coincidence, will be different from them. 29 A MONTE CARLO EXPERIMENT

31
This time the slope coefficient has been underestimated and the intercept overestimated. 30 A MONTE CARLO EXPERIMENT

32
We will repeat the process once more. 31 A MONTE CARLO EXPERIMENT

33
A new set of random numbers has been used in generating the values of Y. 32 A MONTE CARLO EXPERIMENT

34
As last time, the slope coefficient has been underestimated and the intercept overestimated. 33 A MONTE CARLO EXPERIMENT

35
The table summarizes the results of the three regressions and adds those obtained repeating the process a further seven times. 34 replication b 1 b 2 11.630.54 22.520.48 32.130.45 42.140.50 51.710.56 61.810.51 71.720.56 83.180.41 91.260.58 101.940.52 A MONTE CARLO EXPERIMENT

36
Here is a histogram for the estimates of 2. Nothing much can be seen yet. 35 10 replications A MONTE CARLO EXPERIMENT

37
Here are the estimates of 2 obtained with 40 further replications of the process. 36 1-10 11-20 21-30 31-40 41-50 0.540.490.540.520.49 0.480.540.460.470.50 0.450.490.450.540.48 0.500.540.500.530.44 0.560.540.410.510.53 0.510.520.530.510.48 0.560.490.530.470.47 0.410.530.470.550.50 0.580.600.510.510.53 0.520.480.470.580.51 A MONTE CARLO EXPERIMENT

38
The histogram is beginning to display a central tendency. 37 50 replications A MONTE CARLO EXPERIMENT

39
This is the histogram with 100 replications. We can see that the distribution appears to be symmetrical around the true value, implying that the estimator is unbiased. 38 100 replications A MONTE CARLO EXPERIMENT

40
However, the distribution is still rather jagged. It would be better to repeat the process 1,000,000 times, perhaps more. 39 100 replications A MONTE CARLO EXPERIMENT

41
The red curve shows the limiting shape of the distribution. It is symmetrical around the true value, indicating that the estimator is unbiased. 40 100 replications A MONTE CARLO EXPERIMENT

42
The distribution is normal because the disturbance term was drawn from a normal distribution. 41 100 replications A MONTE CARLO EXPERIMENT

43
Copyright Christopher Dougherty 2011. These slideshows may be downloaded by anyone, anywhere for personal use. Subject to respect for copyright and, where appropriate, attribution, they may be used as a resource for teaching an econometrics course. There is no need to refer to the author. The content of this slideshow comes from Section 2.4 of C. Dougherty, Introduction to Econometrics, fourth edition 2011, Oxford University Press. Additional (free) resources for both students and instructors may be downloaded from the OUP Online Resource Centre http://www.oup.com/uk/orc/bin/9780199567089/http://www.oup.com/uk/orc/bin/9780199567089/. Individuals studying econometrics on their own and who feel that they might benefit from participation in a formal course should consider the London School of Economics summer school course EC212 Introduction to Econometrics http://www2.lse.ac.uk/study/summerSchools/summerSchool/Home.aspx http://www2.lse.ac.uk/study/summerSchools/summerSchool/Home.aspx or the University of London International Programmes distance learning course 20 Elements of Econometrics www.londoninternational.ac.uk/lsewww.londoninternational.ac.uk/lse. 11.07.25

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google