In this last subsection the packagesurcaandvarsare presented. The focus of the for- mer is the analysis of integrated and co-integrated time series, whereas the emphasis of the latter is on the implementation of multivariate time series models and infer- ences associated with these as described in Section 13.2.2. Thus, the packages are mutually complementary. A detailed description is provided in Pfaff (2008a, c). Both packages are hosted on CRAN and are contained in the “Econometrics,” “Finance,”
and “TimeSeries” Task Views. The packageurcais considered a core package in the first two Task Views.
k k In the packageurcaS4classes and methods are employed. To assess the degree of
integration of a time series, the following unit root/stationary tests are implemented (in alphabetical order of the authors’ names):5
•(augmented) Dickey–Fuller (ADF) (see Dickey and Fuller 1979, 1981), ur.df();
•Elliot–Rothenberg–Stock (ERS) (see Elliott et al. 1996),ur.ers();
•Kwiatkowski–Phillips–Schmidt–Shin (see Kwiatkowski et al. 1992), ur.kpss();
•Phillips–Perron (see Phillips and Perron 1988),ur.pp();
•Schmidt–Phillips (see Schmidt and Phillips 1992),ur.sp();
•Zivot–Andrews (see Zivot and Andrews 1992),ur.za().
Each of these functions returns anS4object with class name the same as the func- tion name. For objects of these classes,show(),summary(), andplot()meth- ods are available. Functions to compute the distribution of unit root/co-integration tests by means of critical surface responses as proposed in MacKinnon (1991, 1996) are available aspunitroot(),qunitroot(), andunitrootTable(). These functions interface with the originalFORTRANroutines, which were kindly provided by MacKinnon.
To investigate the long-run relationship between integrated time series, the procedures proposed by Johansen (1988, 1991, 1995) and Johansen and Juselius (1990, 1992) (as functionca.jo()) and Phillips and Ouliaris (1990) (as function ca.po()) can be used. Both functions return S4 objects of the same name as the generating functions, and show(), summary(), and plot()methods are defined for these kinds of object. Numerous functions are also available to handle the ML approach to estimation and inference of/from VECM models. Unrestricted and restricted estimates for the left-hand-side coefficients are returned by the functionscajools() andcajorls(), respectively. The VECM residuals can be inspected graphically by the function plotres(). Inference on the kind of long-run relationship(s) and the validity of restrictions imposed can be conducted with the functions alrtest(), blrtest(), ablrtest(), bh5lrtest(), and bh6lrtest(). All of these return an S4 object cajo.test for which show()andsummary()methods are available. A test of the co-integration rank by allowing a level shift at an unknown point in time, as proposed by Lütkepohl et al. (2004), can be conducted with the functioncajolst(). Finally, the package is shipped with 15 data sets for replicating results in the references cited.
In contrast tourca,S3classes and methods have been employed in the package vars. An overview of the informal classes, methods, and functions implemented is provided in Table 13.1.
5Facilities for testing the degree of integration are also implemented in the packages tseries (see Trapletti and Hornik 2015) andfUnitRoots(see Würtz 2013c).
k k Table 13.1 Structure of packagevars.
Function/method Class Methods for class Functions for class VAR() varest coef(),fevd(),
fitted(), irf(), logLik(), Phi(),plot(), predict(), print(),Psi(), resid(),
summary()
Acoef(), arch.test(), Bcoef(),BQ(), causality(), normal- ity.test(), restrict(), roots(),
serial.test(), stability() SVAR() svarest fevd(),irf(),
logLik(), Phi(),print(), summary() SVEC() svecest fevd(),irf(),
logLik(), Phi(),print(), summary() vec2var() vec2var fevd(),
fitted(), irf(), logLik(), Phi(), predict(), print(),Psi(), resid()
arch.test(), normal- ity.test(), serial.test()
fevd() varfevd plot(),print() irf() varirf plot(),print()
predict() varprd plot(),print() fanchart() summary() varsum,
svarsum, svecsum
print()
arch.test() varcheck plot(),print() normality.test()varcheck plot(),print() serial.test() varcheck plot(),print() stability() varstabil plot(),print()
k k The cornerstone functions for estimating VAR, SVAR, or SVEC models are
VAR(),SVAR(), andSVEC(), respectively. The link betweenurcaandvarsis established by converting a VECM model (object ofS4classca.jo) into its level form by means of the functionvec2var(). For all of these returned model objects at least summary(), logLik(), and plot() methods are available. Further- more, impulse response functions and the forecast error variance decomposition are returned by the methodsirf()andfevd(), respectively. For objects with class attributesvarestorvec2var, statistical tests for assessing whether the error term is spherical and/or normally distributed or not can be accomplished by the functions serial.test(), arch.test(), and normality.test(), with obvious meanings. These functions return an object with class attributevarcheckfor which aplot()method is available. In addition to the statistical testing procedures for these two classes, extractor methods for the fitted values (fitted()) and residuals (residuals()) are available. To obtain forecasts from a VAR or VECM-in-level model, predict() methods can be used. These produce point forecasts for n.ahead steps with associated confidence bands at the level determined by the argument ci (the default is 95%). Finally, the data set Canada for replicating the results of Lỹtkepohl and Krọtzig (2004) as shown in the package’s vignette is included invars.