Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 103 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
103
Dung lượng
444,3 KB
File đính kèm
37. TESTING AUTOCORRELATION.rar
(373 KB)
Nội dung
A general approach to testing for autocorrelation Christopher F Baum & Mark E Schaffer Boston College/DIW Berlin Heriot–Watt University/CEPR/IZA Stata Conference, New Orleans, July 2013 Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 / 44 Introduction Introduction Testing for autocorrelation in a time series is a common task for researchers working with time-series data We present a new Stata command, actest, which generalizes our earlier ivactest (Baum, Schaffer, Stillman, Stata Journal 7:4, 2007) and provides a more versatile framework for autocorrelation testing Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 / 44 Introduction Introduction Testing for autocorrelation in a time series is a common task for researchers working with time-series data We present a new Stata command, actest, which generalizes our earlier ivactest (Baum, Schaffer, Stillman, Stata Journal 7:4, 2007) and provides a more versatile framework for autocorrelation testing Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 / 44 Background Background The standard Q test statistic, Stata’s wntestq (Box and Pierce, 1970), refined by Ljung and Box (1978), is applicable for univariate time series under the assumption of strictly exogenous regressors Breusch (1978) and Godfrey (1978) in effect extended the B-P-L-B approach (Stata’s estat bgodfrey, B-G) to test for autocorrelation in models with weakly exogenous regressors Although these tests are more general and much more useful than tests that consider only the AR(1) alternative, such as the Durbin–Watson statistic, the B-P-L-B and B-G tests have important limitations Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 / 44 Background Background The standard Q test statistic, Stata’s wntestq (Box and Pierce, 1970), refined by Ljung and Box (1978), is applicable for univariate time series under the assumption of strictly exogenous regressors Breusch (1978) and Godfrey (1978) in effect extended the B-P-L-B approach (Stata’s estat bgodfrey, B-G) to test for autocorrelation in models with weakly exogenous regressors Although these tests are more general and much more useful than tests that consider only the AR(1) alternative, such as the Durbin–Watson statistic, the B-P-L-B and B-G tests have important limitations Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 / 44 Background Background The standard Q test statistic, Stata’s wntestq (Box and Pierce, 1970), refined by Ljung and Box (1978), is applicable for univariate time series under the assumption of strictly exogenous regressors Breusch (1978) and Godfrey (1978) in effect extended the B-P-L-B approach (Stata’s estat bgodfrey, B-G) to test for autocorrelation in models with weakly exogenous regressors Although these tests are more general and much more useful than tests that consider only the AR(1) alternative, such as the Durbin–Watson statistic, the B-P-L-B and B-G tests have important limitations Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 / 44 Background Limitations of earlier tests The B-P-L-B and Breusch–Godfrey tests are not applicable: when serial correlation up to order q is expected to be present, so they cannot test for serial correlation at orders q + 1, q + for q>0 when the model contains endogenous regressors and is thus estimated by IV or IV-GMM in the context of overlapping data, as we often encounter in the financial markets in the presence of conditional heteroskedasticity in the error process Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 / 44 Background Limitations of earlier tests The B-P-L-B and Breusch–Godfrey tests are not applicable: when serial correlation up to order q is expected to be present, so they cannot test for serial correlation at orders q + 1, q + for q>0 when the model contains endogenous regressors and is thus estimated by IV or IV-GMM in the context of overlapping data, as we often encounter in the financial markets in the presence of conditional heteroskedasticity in the error process Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 / 44 Background Limitations of earlier tests The B-P-L-B and Breusch–Godfrey tests are not applicable: when serial correlation up to order q is expected to be present, so they cannot test for serial correlation at orders q + 1, q + for q>0 when the model contains endogenous regressors and is thus estimated by IV or IV-GMM in the context of overlapping data, as we often encounter in the financial markets in the presence of conditional heteroskedasticity in the error process Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 / 44 Background Limitations of earlier tests The B-P-L-B and Breusch–Godfrey tests are not applicable: when serial correlation up to order q is expected to be present, so they cannot test for serial correlation at orders q + 1, q + for q>0 when the model contains endogenous regressors and is thus estimated by IV or IV-GMM in the context of overlapping data, as we often encounter in the financial markets in the presence of conditional heteroskedasticity in the error process Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 / 44 Cumby–Huizinga test vs Arellano–Bond test Application to IV-GMM with cluster-robust VCE In the panel context, we are considering whether actest should also accept residuals produced by areg, as in that framework the partialled-out fixed effects can be treated as predetermined, so that application of the C-H test is straightforward Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 40 / 44 actest syntax actest syntax The current version of actest may be employed with a varname, in which case that variable is tested; otherwise, it is assumed that an appropriate estimation command has been previously executed, and the residuals from that command are to be tested As we have demonstrated, actest implements a number of options that allow it to match, the results of a number of other tests for autocorrelation These include: lags(numlist): specifies the lag orders at which autocorrelation is to be tested If a single value, tested up to that value If a numlist, tested for that range of lags, assuming autocorrelation at lower lag orders under the null strictexog: regressors in prior estimation are assumed to be strictly exogenous, as they are in B-P-L-B tests Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 41 / 44 actest syntax actest syntax The current version of actest may be employed with a varname, in which case that variable is tested; otherwise, it is assumed that an appropriate estimation command has been previously executed, and the residuals from that command are to be tested As we have demonstrated, actest implements a number of options that allow it to match, the results of a number of other tests for autocorrelation These include: lags(numlist): specifies the lag orders at which autocorrelation is to be tested If a single value, tested up to that value If a numlist, tested for that range of lags, assuming autocorrelation at lower lag orders under the null strictexog: regressors in prior estimation are assumed to be strictly exogenous, as they are in B-P-L-B tests Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 41 / 44 actest syntax actest syntax The current version of actest may be employed with a varname, in which case that variable is tested; otherwise, it is assumed that an appropriate estimation command has been previously executed, and the residuals from that command are to be tested As we have demonstrated, actest implements a number of options that allow it to match, the results of a number of other tests for autocorrelation These include: lags(numlist): specifies the lag orders at which autocorrelation is to be tested If a single value, tested up to that value If a numlist, tested for that range of lags, assuming autocorrelation at lower lag orders under the null strictexog: regressors in prior estimation are assumed to be strictly exogenous, as they are in B-P-L-B tests Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 41 / 44 actest syntax options q0: for single lag-order tests, null hypothesis specifies no autocorrelation (q = 0) bp: perform the Box–Pierce test small: perform the Ljung–Box variant of the Box–Pierce test, with small-sample correction robust: make test robust to arbitrary heteroskedasticity in the error process cluster(varlist): make test cluster-robust to specified variable(s): two-way clustering is supported, as in ivreg2 Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 42 / 44 actest syntax options q0: for single lag-order tests, null hypothesis specifies no autocorrelation (q = 0) bp: perform the Box–Pierce test small: perform the Ljung–Box variant of the Box–Pierce test, with small-sample correction robust: make test robust to arbitrary heteroskedasticity in the error process cluster(varlist): make test cluster-robust to specified variable(s): two-way clustering is supported, as in ivreg2 Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 42 / 44 actest syntax options q0: for single lag-order tests, null hypothesis specifies no autocorrelation (q = 0) bp: perform the Box–Pierce test small: perform the Ljung–Box variant of the Box–Pierce test, with small-sample correction robust: make test robust to arbitrary heteroskedasticity in the error process cluster(varlist): make test cluster-robust to specified variable(s): two-way clustering is supported, as in ivreg2 Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 42 / 44 actest syntax options q0: for single lag-order tests, null hypothesis specifies no autocorrelation (q = 0) bp: perform the Box–Pierce test small: perform the Ljung–Box variant of the Box–Pierce test, with small-sample correction robust: make test robust to arbitrary heteroskedasticity in the error process cluster(varlist): make test cluster-robust to specified variable(s): two-way clustering is supported, as in ivreg2 Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 42 / 44 actest syntax options q0: for single lag-order tests, null hypothesis specifies no autocorrelation (q = 0) bp: perform the Box–Pierce test small: perform the Ljung–Box variant of the Box–Pierce test, with small-sample correction robust: make test robust to arbitrary heteroskedasticity in the error process cluster(varlist): make test cluster-robust to specified variable(s): two-way clustering is supported, as in ivreg2 Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 42 / 44 actest syntax options bw(#): make test robust to arbitrary autocorrelation, using the specified bandwidth in kernel estimator This is the appropriate VCE to use, in conjunction with the default truncated kernel, when you know the degree of autocorrelation under the null This is the case for overlapping data, where a given MA(q) process is induced kernel(string): make test robust to arbitrary autocorrelation, using specified kernel (per choices in ivreg2 Caution: generally, the default truncated kernel will be appropriate for HAC-robustified tests psd(string): some kernel-robust VCEs are not guaranteed to produce positive semidefinite VCEs in finite samples Default behavior: replace negative eigenvalues with absolute values, per Stock and Watson, Econometrica, 2008 With the psd(psd0) option, negative eigenvalues are replaced with zeros Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 43 / 44 actest syntax options bw(#): make test robust to arbitrary autocorrelation, using the specified bandwidth in kernel estimator This is the appropriate VCE to use, in conjunction with the default truncated kernel, when you know the degree of autocorrelation under the null This is the case for overlapping data, where a given MA(q) process is induced kernel(string): make test robust to arbitrary autocorrelation, using specified kernel (per choices in ivreg2 Caution: generally, the default truncated kernel will be appropriate for HAC-robustified tests psd(string): some kernel-robust VCEs are not guaranteed to produce positive semidefinite VCEs in finite samples Default behavior: replace negative eigenvalues with absolute values, per Stock and Watson, Econometrica, 2008 With the psd(psd0) option, negative eigenvalues are replaced with zeros Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 43 / 44 actest syntax options bw(#): make test robust to arbitrary autocorrelation, using the specified bandwidth in kernel estimator This is the appropriate VCE to use, in conjunction with the default truncated kernel, when you know the degree of autocorrelation under the null This is the case for overlapping data, where a given MA(q) process is induced kernel(string): make test robust to arbitrary autocorrelation, using specified kernel (per choices in ivreg2 Caution: generally, the default truncated kernel will be appropriate for HAC-robustified tests psd(string): some kernel-robust VCEs are not guaranteed to produce positive semidefinite VCEs in finite samples Default behavior: replace negative eigenvalues with absolute values, per Stock and Watson, Econometrica, 2008 With the psd(psd0) option, negative eigenvalues are replaced with zeros Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 43 / 44 actest syntax Housekeeping details Some housekeeping details: actest essentially supersedes ivactest, as described in Baum–Schaffer–Stillman, Stata Journal 7:4 Users of the earlier routine should ssc install actest actest makes use of the same Mata object library, livreg2.mlib, used by the Baum–Schaffer–Stillman ivreg2 package in its recent versions, providing access to all VCE options in ivreg2 such as two-way clustering The library will be automatically installed with actest Some relevant references: Cumby and Huizinga, Econometrica 60:1, 1992, 185–195; Cumby and Huizinga, NBER Technical Working Paper 90, 1990; Arellano and Bond, Review of Economic Studies 58:2, 1991, 277–297; Roodman, Stata Journal 12:4, 2012, 766–767 Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 44 / 44 actest syntax Housekeeping details Some housekeeping details: actest essentially supersedes ivactest, as described in Baum–Schaffer–Stillman, Stata Journal 7:4 Users of the earlier routine should ssc install actest actest makes use of the same Mata object library, livreg2.mlib, used by the Baum–Schaffer–Stillman ivreg2 package in its recent versions, providing access to all VCE options in ivreg2 such as two-way clustering The library will be automatically installed with actest Some relevant references: Cumby and Huizinga, Econometrica 60:1, 1992, 185–195; Cumby and Huizinga, NBER Technical Working Paper 90, 1990; Arellano and Bond, Review of Economic Studies 58:2, 1991, 277–297; Roodman, Stata Journal 12:4, 2012, 766–767 Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 44 / 44 actest syntax Housekeeping details Some housekeeping details: actest essentially supersedes ivactest, as described in Baum–Schaffer–Stillman, Stata Journal 7:4 Users of the earlier routine should ssc install actest actest makes use of the same Mata object library, livreg2.mlib, used by the Baum–Schaffer–Stillman ivreg2 package in its recent versions, providing access to all VCE options in ivreg2 such as two-way clustering The library will be automatically installed with actest Some relevant references: Cumby and Huizinga, Econometrica 60:1, 1992, 185–195; Cumby and Huizinga, NBER Technical Working Paper 90, 1990; Arellano and Bond, Review of Economic Studies 58:2, 1991, 277–297; Roodman, Stata Journal 12:4, 2012, 766–767 Baum & Schaffer (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 44 / 44 ... (BC, HWU) Testing for autocorrelation Stata Conference, July 2013 16 / 44 The Cumby–Huizinga test in perspective Testing for independence in regression residuals The Cumby–Huizinga test in perspective... 0.0000 Testing for autocorrelation Stata Conference, July 2013 17 / 44 The Cumby–Huizinga test in perspective Testing for independence in regression residuals The Cumby–Huizinga test in perspective... extended command, actest, for the testing of autocorrelation in the errors of OLS, IV, IV-GMM and LIML estimates for a single time series, including testing for autocorrelation at specific lag