Implementing a Class of Structural Change Tests: An Econometric Computing Approach



Similar documents
Testing, Monitoring, and Dating Structural Changes in Exchange Rate Regimes

A Unified Approach to Structural Change Tests Based on ML Scores, F Statistics, and OLS Residuals

Monitoring Structural Change in Dynamic Econometric Models

Model-Based Recursive Partitioning for Detecting Interaction Effects in Subgroups

Generalized M-Fluctuation Tests for Parameter Instability

Exchange Rate Regime Analysis for the Chinese Yuan

From the help desk: Bootstrapped standard errors

Generalized Linear Models

Calculating the Probability of Returning a Loan with Binary Probability Models

Implementing Panel-Corrected Standard Errors in R: The pcse Package

STATISTICA Formula Guide: Logistic Regression. Table of Contents

Simple Linear Regression Inference

On Reproducible Econometric Research

Chapter 5: Bivariate Cointegration Analysis

Multiple Linear Regression

Time Series Analysis

Factors affecting online sales

Online Appendix to Are Risk Preferences Stable Across Contexts? Evidence from Insurance Data

SAS Software to Fit the Generalized Linear Model

Financial Risk Models in R: Factor Models for Asset Returns. Workshop Overview

CHAPTER 12 EXAMPLES: MONTE CARLO SIMULATION STUDIES

Online Appendices to the Corporate Propensity to Save

No More Weekend Effect

Solución del Examen Tipo: 1

MONT 107N Understanding Randomness Solutions For Final Examination May 11, 2010

Please follow the directions once you locate the Stata software in your computer. Room 114 (Business Lab) has computers with Stata software

ECLT5810 E-Commerce Data Mining Technique SAS Enterprise Miner -- Regression Model I. Regression Node

R: A Free Software Project in Statistical Computing

2013 MBA Jump Start Program. Statistics Module Part 3

Linda K. Muthén Bengt Muthén. Copyright 2008 Muthén & Muthén Table Of Contents

Chapter 7: Simple linear regression Learning Objectives

partykit: A Toolkit for Recursive Partytioning

Multivariate Logistic Regression

Package dsmodellingclient

Audit Analytics. --An innovative course at Rutgers. Qi Liu. Roman Chinchila

R: A Free Software Project in Statistical Computing

Examining a Fitted Logistic Model

Logistic Regression (a type of Generalized Linear Model)

430 Statistics and Financial Mathematics for Business

Service courses for graduate students in degree programs other than the MS or PhD programs in Biostatistics.

Chicago Booth BUSINESS STATISTICS Final Exam Fall 2011

Bootstrapping Big Data

What s New in Econometrics? Lecture 8 Cluster and Stratified Sampling

Lecture 6: Poisson regression

Simple Methods and Procedures Used in Forecasting

Chapter 5 Analysis of variance SPSS Analysis of variance

HLM software has been one of the leading statistical packages for hierarchical

Regression Modeling Strategies

CHAPTER 3 EXAMPLES: REGRESSION AND PATH ANALYSIS

THE IMPACT OF EXCHANGE RATE VOLATILITY ON BRAZILIAN MANUFACTURED EXPORTS

Cross Validation techniques in R: A brief overview of some methods, packages, and functions for assessing prediction models.

Business Statistics. Successful completion of Introductory and/or Intermediate Algebra courses is recommended before taking Business Statistics.

Regression Analysis (Spring, 2000)

We extended the additive model in two variables to the interaction model by adding a third term to the equation.

Online Appendix Assessing the Incidence and Efficiency of a Prominent Place Based Policy

ASSESSING FINANCIAL EDUCATION: EVIDENCE FROM BOOTCAMP. William Skimmyhorn. Online Appendix

Data Mining and Data Warehousing. Henryk Maciejewski. Data Mining Predictive modelling: regression

Regression III: Advanced Methods

Model-based Recursive Partitioning

Using R for Linear Regression

Statistics Graduate Courses

Simple Predictive Analytics Curtis Seare

GLM I An Introduction to Generalized Linear Models

Vector Time Series Model Representations and Analysis with XploRe

Correlation and Simple Linear Regression

Package neuralnet. February 20, 2015

Testing for Granger causality between stock prices and economic growth

Overview of Violations of the Basic Assumptions in the Classical Normal Linear Regression Model

Additional sources Compilation of sources:

Implementations of tests on the exogeneity of selected. variables and their Performance in practice ACADEMISCH PROEFSCHRIFT

Course Text. Required Computing Software. Course Description. Course Objectives. StraighterLine. Business Statistics

Chicago Insurance Redlining - a complete example

Package empiricalfdr.deseq2

Example: Credit card default, we may be more interested in predicting the probabilty of a default than classifying individuals as default or not.

A Handbook of Statistical Analyses Using R. Brian S. Everitt and Torsten Hothorn

Introduction to General and Generalized Linear Models

High Performance Predictive Analytics in R and Hadoop:

SYSTEMS OF REGRESSION EQUATIONS

Statistical Models in R

Discussion Section 4 ECON 139/ Summer Term II

Review Jeopardy. Blue vs. Orange. Review Jeopardy

1. What is the critical value for this 95% confidence interval? CV = z.025 = invnorm(0.025) = 1.96

Introduction to Regression and Data Analysis

Why Taking This Course? Course Introduction, Descriptive Statistics and Data Visualization. Learning Goals. GENOME 560, Spring 2012

Quantitative Methods for Finance

BayesX - Software for Bayesian Inference in Structured Additive Regression

Time Series Analysis: Basic Forecasting.

Advanced Forecasting Techniques and Models: ARIMA

Section 6: Model Selection, Logistic Regression and more...

Corporate Defaults and Large Macroeconomic Shocks

Institute of Actuaries of India Subject CT3 Probability and Mathematical Statistics

Transcription:

Implementing a Class of Structural Change Tests: An Econometric Computing Approach Achim Zeileis http://www.ci.tuwien.ac.at/~zeileis/

Contents Why should we want to do tests for structural change, econometric computing? Generalized M-fluctuation tests Empirical fluctuation processes: gefp Functionals for testing: efpfunctional Applications Austrian National Guest Survey

Structural change tests Structural change has been receiving a lot of attention in econometrics and statistics, particularly in time series econometrics. Aim: to learn if, when and how the structure underlying a set of observations changes. In a parametric model with parameter θ i for n totally ordered observations Y i test the null hypothesis of parameter constancy against changes over time. H 0 : θ i = θ 0 (i = 1,..., n).

Econometric computing Econometrics & computing: Computational econometrics: methods requiring substantial computations (bootstrap or Monte Carlo methods), Econometric computing: translating econometric ideas into software. To transport methodology to the users and apply new methods to data software is needed.

Econometric computing Desirable features of an implementation: easy to use, numerically reliable, computationally efficient, flexible and extensible, reusable components, open source, object oriented, reflect features of the conceptual method. Undesirable: single monolithic functions. Also important: software delivery.

Econometric computing All methods implemented in the R system for statistical computing and graphics http://www.r-project.org/ in the contributed package strucchange. Both are available under the GPL (General Public Licence) from the Comprehensive R Archive Network (CRAN): http://cran.r-project.org/

Guest Survey Austria Data from the Austrian National Guest Survey about the summer seasons 1994 and 1997. Here: use logistic regression model response: cycling as a vacation activity (done/not done), available regressors: age (in years), household income (in ATS/month), gender and year (as a factors/dummies), fit model for the subset of male tourists (6256 observations), (log-)income is not significant. R> gsa.fm <- glm(cycle ~ poly(age, 2) + Year, data = gsa, family = binomial) But: Maybe there are instabilities in the model for increasing income?

M-fluctuation tests fit model compute empirical fluctuation process reflecting fluctuation in residuals coefficient estimates M-scores (including OLS or ML scores etc.) theoretical limiting process is known choose boundaries which are crossed by the limiting process (or some functional of it) only with a known probability α. if the empirical fluctuation process crosses the theoretical boundaries the fluctuation is improbably large reject the null hypothesis.

Empirical fluctuation processes Model fitting: parameters can often be estimated based on a score function or estimating equation ψ with E[ψ(Y i, θ i )] = 0. Under parameter stability estimate θ 0 by: n i=1 ψ(y i, ˆθ) = 0. Includes: OLS, ML, Quasi-ML, robust M-estimation, IV, GMM, GEE. Available in R: linear models lm, GLMs, logit, probit models glm, robust regression rlm, etc.

Empirical fluctuation processes Test idea: if θ is not constant the scores ψ should fluctuate and systematically deviate from 0. Capture fluctuations by partial sums: nt efp(t) = Ĵ 1/2 n 1/2 i=1 and scale by covariance matrix estimate Ĵ. ψ(y i, ˆθ).

Empirical fluctuation processes Test idea: if θ is not constant the scores ψ should fluctuate and systematically deviate from 0. Capture fluctuations by partial sums: nt efp(t) = Ĵ 1/2 n 1/2 i=1 and scale by covariance matrix estimate Ĵ. ψ(y i, ˆθ). Functional central limit theorem: empirical fluctuation process converges to a Brownian bridge efp( ) d W 0 ( )

Empirical fluctuation processes Implementation idea: don t reinvent the wheel: use existing model fitting functions and just extract the scores or estimating functions, also allow plug-in of HC and HAC covariance matrix estimators, provide infrastructure for computing processes.

Empirical fluctuation processes Implementation idea: don t reinvent the wheel: use existing model fitting functions and just extract the scores or estimating functions, also allow plug-in of HC and HAC covariance matrix estimators, provide infrastructure for computing processes. gefp(..., fit = glm, scores = estfun, vcov = NULL, order.by = NULL)

Empirical fluctuation processes For Austrian guest survey data: R> gsa.efp <- gefp(cycle ~ poly(age, 2) + Year, family = binomial, data = gsa, order.by = ~ log(hhincome), parm = 1:3)

Empirical fluctuation processes poly(age, 2)2 poly(age, 2)1 (Intercept) 0.0 1.0 2.0 1.0 0.0 0.5 0.5 1.5 6 8 10 12 log(household Income)

Functionals The empirical fluctuation process can be aggregated to a scalar test statistic by a functional λ( ) λ ( ( )) i efp j, n where j = 1,..., k and i = 1,... n. λ can usually be split into two components: λ time and λ comp. Typical choices for λ time : L (absolute maximum), mean, range. Typical choice for λ comp : L, L 2. can identify component and/or timing of shift.

Functionals Double maximum statistic: max max i=1,...,n j=1,...,k efp j (i/n) b(i/n), typically with b(t) = 1. Cramér-von Mises statistic: n 1 n i=1 efp j (i/n) 2 2, Critical values can easily be obtained by simulation of λ(w 0 ). In certain special cases, closed form solutions are known.

Functionals Implementation idea: specify functional (and boundary function) simulate critical values (or use closed form solution) combine all information about a functional in a single object: process visualization, computation of test statistic, computation of p values, provide infrastructure which can be used by the methods of the generic functions plot for visualization and sctest for significance testing. For the double maximum and the Cramér-von Mises functionals such objects are available in strucchange: maxbb, meanl2bb.

Functionals R> plot(gsa.efp, functional = maxbb) M fluctuation test empirical fluctuation process 0.0 0.5 1.0 1.5 2.0 6 8 10 12 Time

Functionals R> plot(gsa.efp, functional = maxbb, aggregate = FALSE) M fluctuation test poly(age, 2)2 poly(age, 2)1 (Intercept) 0.0 1.0 2.0 1.0 0.0 0.5 0.5 1.5 6 8 10 12 Time

Functionals R> plot(gsa.efp, functional = meanl2bb) M fluctuation test empirical fluctuation process 0 1 2 3 4 6 8 10 12 Time

Functionals R> sctest(gsa.efp, functional = maxbb) M-fluctuation test data: gsa.efp f(efp) = 2.0594, p-value = 0.001242 R> sctest(gsa.efp, functional = meanl2bb) M-fluctuation test data: gsa.efp f(efp) = 2.2119, p-value = 0.005

Functionals New functionals can be easily generated with efpfunctional( functional = list(comp = function(x) max(abs(x)), time = max), boundary = function(x) rep(1, length(x)), computepval = NULL, computecritval = NULL, nobs = 10000, nrep = 50000, nproc = 1:20) An object created by efpfunctional has slots with functions plotprocess computestatistic computepval that are defined based on lexical scoping.

Functionals Use functional similar to double max functional, but with boundary function b(t) = t (1 t) + 0.05, which is proportional to the standard deviation of the process plus an offset. myfun1 <- efpfunctional( functional = list(comp = function(x) max(abs(x)), time = max), boundary = function(x) sqrt(x * (1-x)) + 0.05, nobs = 10000, nrep = 50000, nproc = NULL)

Functionals R> plot(gsa.efp, functional = myfun1) M fluctuation test empirical fluctuation process 0.0 0.5 1.0 1.5 2.0 6 8 10 12 Time

Functionals Use standard double max functional but aggregate over time first. Leads to the same test statistic and p value, but the aggregated process looks different. myfun2 <- efpfunctional( functional = list(time = function(x) max(abs(x)), comp = max), computepval = maxbb$computepval)

Functionals R> plot(gsa.efp, functional = myfun2) M fluctuation test Statistic 0.0 0.5 1.0 1.5 2.0 (Intercept) poly(age, 2)1 poly(age, 2)2 Component

Functionals R> sctest(gsa.efp, functional = myfun1) M-fluctuation test data: gsa.efp f(efp) = 4.7947, p-value = < 2.2e-16 R> sctest(gsa.efp, functional = myfun2) M-fluctuation test data: gsa.efp f(efp) = 2.0594, p-value = 0.001242

Conclusions The general class of M-fluctuation tests is implemented in strucchange: gefp computation of empirical fluctuation processes from (possibly user-defined) estimation functions, efpfunctional aggregation of empirical fluctuation processes to test statistics, automatic tabulation of critical values, plot and sctest methods for visualization and significance testing based on empirical fluctuation processes and corresponding functionals.

See more at... The 1st R user conference Vienna, May 20 22, 2004 http://www.ci.tuwien.ac.at/conferences/user-2004/