( ) ln ( ) is a new random error term. Mathematically, the vt. behave according to

Similar documents
R t. C t P t. + u t. C t = αp t + βr t + v t. + β + w t

Dynamic Models, Autocorrelation and Forecasting

Econ Autocorrelation. Sanjaya DeSilva

Distribution of Least Squares

Econ107 Applied Econometrics Topic 7: Multicollinearity (Studenmund, Chapter 8)

Regression with Time Series Data

Solutions to Odd Number Exercises in Chapter 6

Distribution of Estimates

Diebold, Chapter 7. Francis X. Diebold, Elements of Forecasting, 4th Edition (Mason, Ohio: Cengage Learning, 2006). Chapter 7. Characterizing Cycles

Wisconsin Unemployment Rate Forecast Revisited

ACE 562 Fall Lecture 5: The Simple Linear Regression Model: Sampling Properties of the Least Squares Estimators. by Professor Scott H.

Bias in Conditional and Unconditional Fixed Effects Logit Estimation: a Correction * Tom Coupé

Stationary Time Series

1. Diagnostic (Misspeci cation) Tests: Testing the Assumptions

Time series Decomposition method

Wednesday, November 7 Handout: Heteroskedasticity

Comparing Means: t-tests for One Sample & Two Related Samples

Solutions to Exercises in Chapter 12

Dynamic Econometric Models: Y t = + 0 X t + 1 X t X t k X t-k + e t. A. Autoregressive Model:

Unit Root Time Series. Univariate random walk

A Specification Test for Linear Dynamic Stochastic General Equilibrium Models

DEPARTMENT OF STATISTICS

Outline. lse-logo. Outline. Outline. 1 Wald Test. 2 The Likelihood Ratio Test. 3 Lagrange Multiplier Tests

Licenciatura de ADE y Licenciatura conjunta Derecho y ADE. Hoja de ejercicios 2 PARTE A

GMM - Generalized Method of Moments

14 Autoregressive Moving Average Models

ACE 562 Fall Lecture 8: The Simple Linear Regression Model: R 2, Reporting the Results and Prediction. by Professor Scott H.

ACE 562 Fall Lecture 4: Simple Linear Regression Model: Specification and Estimation. by Professor Scott H. Irwin

Testing the Random Walk Model. i.i.d. ( ) r

Chapter 11. Heteroskedasticity The Nature of Heteroskedasticity. In Chapter 3 we introduced the linear model (11.1.1)

Introduction D P. r = constant discount rate, g = Gordon Model (1962): constant dividend growth rate.

Chapter 16. Regression with Time Series Data

Innova Junior College H2 Mathematics JC2 Preliminary Examinations Paper 2 Solutions 0 (*)

OBJECTIVES OF TIME SERIES ANALYSIS

A note on spurious regressions between stationary series

Kriging Models Predicting Atrazine Concentrations in Surface Water Draining Agricultural Watersheds

Financial Econometrics Jeffrey R. Russell Midterm Winter 2009 SOLUTIONS

y = β 1 + β 2 x (11.1.1)

Properties of Autocorrelated Processes Economics 30331

STAD57 Time Series Analysis. Lecture 5

Nonlinearity Test on Time Series Data

3.1 More on model selection

Hypothesis Testing in the Classical Normal Linear Regression Model. 1. Components of Hypothesis Tests

ACE 564 Spring Lecture 7. Extensions of The Multiple Regression Model: Dummy Independent Variables. by Professor Scott H.

(a) Set up the least squares estimation procedure for this problem, which will consist in minimizing the sum of squared residuals. 2 t.

t is a basis for the solution space to this system, then the matrix having these solutions as columns, t x 1 t, x 2 t,... x n t x 2 t...

Vehicle Arrival Models : Headway

Lecture 33: November 29

Forecasting optimally

Modeling and Forecasting Volatility Autoregressive Conditional Heteroskedasticity Models. Economic Forecasting Anthony Tay Slide 1

Department of Economics East Carolina University Greenville, NC Phone: Fax:

Generalized Least Squares

Vectorautoregressive Model and Cointegration Analysis. Time Series Analysis Dr. Sevtap Kestel 1

The Simple Linear Regression Model: Reporting the Results and Choosing the Functional Form

Chapter 15. Time Series: Descriptive Analyses, Models, and Forecasting

Estimation Uncertainty

Math 10B: Mock Mid II. April 13, 2016

Solutions: Wednesday, November 14

On Measuring Pro-Poor Growth. 1. On Various Ways of Measuring Pro-Poor Growth: A Short Review of the Literature

Chapter 5. Heterocedastic Models. Introduction to time series (2008) 1

Nature Neuroscience: doi: /nn Supplementary Figure 1. Spike-count autocorrelations in time.

NCSS Statistical Software. , contains a periodic (cyclic) component. A natural model of the periodic component would be

The Multiple Regression Model: Hypothesis Tests and the Use of Nonsample Information

Quarterly ice cream sales are high each summer, and the series tends to repeat itself each year, so that the seasonal period is 4.

Cointegration and Implications for Forecasting

ECON 482 / WH Hong Time Series Data Analysis 1. The Nature of Time Series Data. Example of time series data (inflation and unemployment rates)

Lecture Notes 2. The Hilbert Space Approach to Time Series

Smoothing. Backward smoother: At any give T, replace the observation yt by a combination of observations at & before T

Biol. 356 Lab 8. Mortality, Recruitment, and Migration Rates

12: AUTOREGRESSIVE AND MOVING AVERAGE PROCESSES IN DISCRETE TIME. Σ j =

Chapter 2. First Order Scalar Equations

Y, where. 1 Estimate St.error

References are appeared in the last slide. Last update: (1393/08/19)

Lecture 10 Estimating Nonlinear Regression Models

Methodology. -ratios are biased and that the appropriate critical values have to be increased by an amount. that depends on the sample size.

How to Deal with Structural Breaks in Practical Cointegration Analysis

The Overlapping Data Problem

THE UNIVERSITY OF TEXAS AT AUSTIN McCombs School of Business

Lecture 4. Classical Linear Regression Model: Overview

Types of Exponential Smoothing Methods. Simple Exponential Smoothing. Simple Exponential Smoothing

CHAPTER 9. Exercise Solutions

Robust estimation based on the first- and third-moment restrictions of the power transformation model

3.1.3 INTRODUCTION TO DYNAMIC OPTIMIZATION: DISCRETE TIME PROBLEMS. A. The Hamiltonian and First-Order Conditions in a Finite Time Horizon

INTRODUCTION TO MACHINE LEARNING 3RD EDITION

DEPARTMENT OF ECONOMICS

Stability. Coefficients may change over time. Evolution of the economy Policy changes

State-Space Models. Initialization, Estimation and Smoothing of the Kalman Filter

Matrix Versions of Some Refinements of the Arithmetic-Geometric Mean Inequality

Choice of Spectral Density Estimator in Ng-Perron Test: A Comparative Analysis

72 Calculus and Structures

Wednesday, December 5 Handout: Panel Data and Unobservable Variables

Forecasting. Summary. Sample StatFolio: tsforecast.sgp. STATGRAPHICS Centurion Rev. 9/16/2013

Granger Causality Among Pre-Crisis East Asian Exchange Rates. (Running Title: Granger Causality Among Pre-Crisis East Asian Exchange Rates)

Box-Jenkins Modelling of Nigerian Stock Prices Data

Økonomisk Kandidateksamen 2005(II) Econometrics 2. Solution

20. Applications of the Genetic-Drift Model

0.1 MAXIMUM LIKELIHOOD ESTIMATION EXPLAINED

Ensamble methods: Bagging and Boosting

(10) (a) Derive and plot the spectrum of y. Discuss how the seasonality in the process is evident in spectrum.

STATE-SPACE MODELLING. A mass balance across the tank gives:

Transcription:

Time series observaions, which are drawn sequenially, usually embody a srucure where ime is an imporan componen. If you are unable o compleely model his srucure in he regression funcion iself, hen he remainder spills over ino he unobserved componen of your model (is error) and his causes he errors of he saisical model o be correlaed wih one anoher. In he following example consider is one wih a lag in he error erm. Below is a supply response for an agriculural crop modeled in log-log form: planed (acres) depends on price. ln ( ) ln ( ) A = β + β P + e 2 The error of he model depends on he previous period s error and whie noise. In ime series analysis i is common o refer o independenly disribued random errors as whie noise. e = ρ e + v where ρ (rho) is a parameer ha describes he dependence of e on e and v is a new random error erm. Mahemaically, he v behave according o E v = v = σ v v = s 2 ( ) 0 var( ) v cov(, s ) 0 for For sabiliy (and saionariy) of he model, we also require < ρ <. As is demonsraed in your ex, he e will be correlaed wih one anoher and are herefore said o be auocorrelaed. Hins In order o use Saa, you ll have o creae a ime variable and declare he daase o be a imeseries. The simples way is gen ime = _n This generaes a new variable ha conains he observaion number. This works because _n is undersood by Saa o mean he observaion number. Then, change he srucure of your daa o a ime series using he sse command sse ime, yearly Now, generae he logarihms of acreage and price, run he regression, and save he residuals gen lp = log(p) gen la = log(a) regress la lp predic eha, residual Now, use he woway(scaer eha ime) o generae a graph of he leas squares residuals.

2 woway (scaer eha ime) From he graph here is some indicaion of posiive auocorrelaion; posiive errors end o follow oher posiive errors and negaive errors follow oher negaive ones. Compuing he correlaion beween e ˆ and eˆ will give you numerical verificaion of wha you see in he graph. Firs, generae lagged values of he residuals. This can be done in several ways. The firs uses Saa s subscriping funcion. Individual elemens of variables and marices may be referred o by subscriping. For insance, he 0 h observaion of he variable x would be referred o as x[0]. The subscrip refers o he observaion number and i is pu inside of square brackes ha follow he variable. To refer o lagged values of he variable eha, you can use he subscrip _n- as in gen eha_ = eha[_n-] The subscrip uses he observaion number (_n) and subracs one from i. So, eha[_n-] poins o e ˆ which i sores in he new variable called eha_. The preferred mehod for generaing lagged values uses Saa s buil in lag funcion. The synax for he lag funcion consiss of a capial leer L followed by he desired lag number (e.g.,, 2, or 3) and a period. This is used as prefix for he variable o be lagged (e.g., L#.varname). For insance, L.gnp refers o he one period lagged value of variable gnp. To lag gnp wo periods, you d use L2.gnp. The lag funcion can be used only if he daa are declared o be ime series or as a panel. The synax o lag eha one period is gen eha_ = L.eha For one period lags (L.varname) he number can be omied (e.g., L.varname). There are oher ime series operaors o ake differences (D.), leads (F.), and seasonal differences (S.) ha use he same synax srucure. The Saa documenaion ha describes how o use hese is cleverly hidden in he online help sysem and can be revealed by yping help svarlis on he command line.

Dynamic Models 3 Finally, o obain he correlaion beween e ˆ and eˆ : correlae eha eha_ which yields eha eha_ eha.0000 eha_ 0.4040.0000 ESTIMATING AN AR() MODEL When he errors follow an AR() model e = ρ e + v, he leas squares assumpion MR4, cov( e, e s ) = 0 for s is violaed. Leas squares is unbiased and consisen, bu no longer efficien. Also, he usual sandard errors are no longer correc, leading o saisically invalid hypohesis ess and confidence inervals. Leas squares and HAC sandard errors Alhough he usual leas squares sandard errors are no correc, we can compue consisen sandard errors jus as we did in heeroskedasic models using an esimaor proposed by Newey and Wes. Newey-Wes sandard errors (also known as HAC (heeroskedasiciy and auocorrelaion consisen) sandard errors are analogous o he heeroskedasiciy consisen sandard errors inroduced earlier in he course. They have he advanage of being consisen in models ha have higher order auocorrelaed errors. Also, hey do no require explici specificaion of he dynamic model of he errors ha would oherwise be needed o esimae he parameers more precisely. HAC is no quie as auomaic as he heeroskedasiciy robus sandard error esimaor. To be robus wih respec o auocorrelaion one has o specify how far away in ime he auocorrelaion is likely o be significan. Essenially, he auocorrelaed errors over he chosen ime window are averaged in he compuaion of HAC; you have o specify how many periods over which o average and how much weigh o assign each residual in ha average. The weighed average is called a kernel and he number of errors o average is called bandwidh. To be quie hones, hese erms shed no ligh on heir meaning for he average user. Jus hink of he kernel as anoher name for weighed average and bandwidh as he erm for number of erms o average. In Saa, you have no conrol over he kernel, bu you can pick a bandwidh. Implicily here is a rade-off o consider. A larger bandwidh reduces bias (good), bu increases variance (bad). A smaller bandwidh excludes more relevan auocorrelaions. While his reduces variance, i increases bias. The radeoff leads o a Goldilocks prescripion o choose he bandwidh ha is jus righ! Unforunaely, where his lies is generally no known and his makes he HAC less aracive in pracice han is heeroskedasicicy robus equivalen. Tha is no o say ha people haven ried o find an opimal bandwidh. Several mehods have been proposed o compue one based on sample size. One mehods uses B = 0.75N /3. The

4 larger your sample, N, he larger he bandwidh is. Anoher popular choice is B= 4 (N/00) 2/9. This one appears o be he defaul in oher programs like EViews and i is he one used here o obain he resuls in he ex. To compue his one in Saa use: scalar B = round(4*(e(n)/00)^(2/9)) scalar lis B This reurns he value 3. The resul is rounded using he round funcion because you have o give Saa a whole number o specify he number of lags o use in he HAC s compuaion. Then, o esimae he model wih leas squares wih Newey-Wes sandard errors use he following command newey la lp, lag(3) The dialog o esimae his model is found by selecing Saisics > Time series > Regression wih Newey-Wes sd. errors. This brings up he newey dialog box shown below. Selec he dependen and independen variables. Then click he radio buon o selec he bandwidh, choosing 3. Click OK and you ll obain he resuls from your ex. Noe, Saa compues he 95% confidence inervals by defaul. If you wish o change α you can do so from he Reporing ab in he dialog. Finally, if you choose he No auocorrelaion srucure in his dialog, you ll ge he usual Whie s sandard errors ha are robus o heeroskedasiciy only. Therefore, if you have auocorrelaion, hen you mus ell Saa he maximum lag o consider. Nonlinear Leas Squares As you can see, HAC sandard errors suffer a leas wo disadvanages: ) hey are no auomaic since hey require specificaion of a bandwidh and 2) hey are larger han sandard errors of more efficien esimaors. In his secion, nonlinear leas squares is used o efficienly esimae he parameers of he AR() model. In your ex book he auhors sar wih he AR() regression model and, using a lile algebra, arrive a y = β ( ρ ) + β x + ρy ρβ x + v 2 2 This model is nonlinear in he parameers, bu has an addiive whie noise error. These feaures make he model suiable for nonlinear leas squares esimaion. Nonlinear leas squares uses numerical mehods o find he values of he parameers ha minimize he sum of squared errors. Saa can do his easily using he nl command. Unforunaely, he nl command canno use Saa s buil in ime series operaors (e.g., L.var, D.var) so you will have o use he generae command o ake he lags of he dependen and independen variables, y and x. These lines use he L. operaor o generae lags of ln(p) and ln(a).

Dynamic Models 5 gen la_ = L.la gen lp_ = L.lp Once hese are defined, he nl command o esimae he model is nl (la = {b}*(-{rho}) + {b2}*lp_+ {rho}*la_ - {rho}*{b2}*(lp_)), variables(lp la la_ lp_) This should be yped on a single line, eiher in a do-file or in he command window. The synax is fairly simple, bu requires some explanaion. The basic synax is: nl (depvar=<sexp>) [if] [in] [weigh] [, opions] Inside he firs se of parenheses you ype in he sysemaic porion of your model. Parameers mus be enclosed in braces {}. You can use he if, in, and weigh saemens jus as you do in a linear regression. However, because you are using variables ha have been lagged, you will now have missing values for he lagged variables in he daa se. For nl o work you mus limi he sample o he complee observaions, i.e., he ones for which nohing is missing. There are wo ways o do his. Firs, you could use (depvar=<sexp>) in 2/34. Or, you can lis he variables as we have done here using he opion variables(lp la la_ lp_). A More General Model A more general form of he model is considered y = δ + δ x + δ x + θ y + v 0 which is linear in he parameers and can be esimaed by linear regression. This model is relaed o he previous model by he relaionships δ = β( ρ) δ 0 = β2 δ = ρβ2 θ = ρ The linear model can be esimaed by (linear) leas squares and a hypohesis es of he implied resricion can be conduced. The null hypohesis implied by he resricion is H : δ = θ δ agains he alernaive ha i is no equal. 0 0 DETECTING AUTOCORRELATION Several mehods are used o deermine he presence or exen of auocorrelaion. The firs is o ake a look a he residual correlogram. A residual correlogram is a graph ha plos series of correlaions beween e ˆ and eˆ j agains he ime inerval beween he observaions, j=,2,, m. So, he firs hing o do ge he residual correlogram is o esimae he model using leas squares and hen save he residuals.

6 regress la lp predic eha, residual Once you have he residuals, use he command ac eha o graph he correlogram. Each do on he correlogram represens he esimaed correlaion beween observaions j periods apar and he shaded area is he 95% confidence bounds. So, in his case he firs auocorrelaion lies ouside of he boundary and is herefore significanly differen from zero a he 5% level. The ohers lie inside he bounds and are no significan. Anoher way o es for auocorrelaion is o use he oupu from nonlinear leas squares, which yields an esimae of ρ and is sandard error. The esimaor of ρ is approximaely normally disribued which means ha you can use is -raio in he usual way. Finally, you can es wheher residuals are correlaed wih one anoher using an LM (Lagrange muliplier) es. For auocorrelaion, his es is based on an auxiliary regression where you regress leas squares residuals on lagged leas squares residuals and he original regressors. If he regressors, which include e ˆ, explain sufficien variaion in e ˆ hen here mus be auocorrelaion due o e ˆ. For a regression model y = β + β x + e, 2 esimae he parameers using leas squares and save he residuals, e ˆ. Lag he residuals o ge e ˆ. Then esimae a second auxiliary regression wih e ˆ as he dependen variable and he lagged value e ˆ as an independen variable. Include all of he oher independen variables from he original regression as well. For a simple linear regression he auxiliary regression is eˆ = γ + γ x + ρ eˆ + residual 2 NR 2 from his regression has a χ 2 () disribuion if he null hypohesis of no auocorrelaion is rue, where N is he number of observaions in he auxiliary regression. Rejecion leads you o conclude here is significan auocorrelaion. If you suspec higher order auocorrelaion, include addiional lags of he residuals. NR 2 from hese regressions has a χ 2 (p) disribuion if he null hypohesis is rue and p is he number of lagged residuals included in he model. Ineresingly, Saa has a buil in command o do his es. I is a pos-esimaion command, which uses esa bgodfrey: regress la lp esa bgodfrey lags(/3)

Dynamic Models 7 bgodfrey sands for Breusch-Godfrey, he las names of he wo economericians credied wih his paricular varian of he es. This command gives he same resul as he manual mehod above. The lags opion specifies which lagged residuals o include in he LM es. AUTOREGRESSIVE MODELS Auoregressive models include lags of he dependen variable as regressors. The AR(p) model is y = δ + θ y + θ y + L + θ y + v 2 2 p p which has p lags of y as regressors. This model is simple o esimae in Saa since i is linear in he parameers. In his example we use he inflaion.da daase and esimae an AR(3) model of he inflaion rae. Firs, load he inflaion daa, clearing he memory of any exising daa. use inflaion, clear You ll noice ha in his daase here are variables for year and monh. These wo variables can be combined o make a ime variable ha we will call. To do his use a funcion called ym (which sands for year/monh) as shown below. gen = ym(year,monh) sse, monhly Since he daa are recorded monhly, we used he monhly opion in declaring o be a ime series wih sse. Once he daa have been declared ime series you can use he buil in ime series operaors (L., L2., L3., ec) o specify lags for variables in he model. The regression is regress infln L.infln L2.infln L3.infln FINITE DISTRIBUTED LAG MODELS Finie disribued lag models conain independen variables and heir lags as regressors. y = α + β 0x + β x + β 2x 2 + L + β qx q + v, = q +, K, T In his example he y is he inflaion rae and i is modeled as a funcion of he percenage change in wages, x, for he curren and hree periods lagged. In erms of he general model, q=3. In Saa he model is linear and esimaed using leas squares

8 regress infln pcwage L.pcwage L2.pcwage L3.pcwage AUTOREGRESSIVE DISTRIBUTED LAG MODELS Finally, we consider an auoregressive model ha also conains a finie disribued lag. This is he so-called auoregressive disribued lag model (ARDL). The ARDL(p,q) model has he general form y = δ + δ x + δ x + L + δ x + θ y + L + θ y + v 0 q q p p I has p lags of he dependen variable, y, and q lags of he independen variable, x. The ARDL(2,3) model of inflaion can be esimaed using leas squares regress infln pcwage L.pcwage L2.pcwage L3.pcwage L.infln L2.infln QUESTION Use he bangla.da daase o esimae he area response model on page using leas squares wih he wrong sandard errors. Plo he residuals agains ime. Plo he correlogram and deermine he likely exen of auocorrelaion. Resesimae he model using leas squares wih HAC sandard errors. QUESTION 2 Esimae he model using assuming firs order auocorrelaion using nonlinear leas squares. Tes he null hypohesis of no auocorrelaion agains firs order auocorrelaion using he nonlinear leas squares resul. If here is higher order auocorrelaion presen, how would you deec i and wha would you do o model i? Use he esnl command o es he nonlinear resricions implied by he NLS esimaor relaive o he more general model on page 5 QUESTION 3 Using he inflaion.da daa esimae he finie disribued lag model and he ARDL model. Plo he correlogram of he residuals from each. Do he errors appear o be correlaed? Using he appropriae Breusch-Godfrey es o es no auocorrelaion agains a suiable alernaive. If furher consideraion of he model s specificaion is warraned, how would you proceed?

Dynamic Models 9