PAckage Apt

Published on August 2022 | Categories: Documents | Downloads: 3 | Comments: 0 | Views: 83
of 19
Download PDF   Embed   Report

Comments

Content

 

Package ‘apt’ January 10, 2014 Title  Asymmetric Price Transmission (apt) Version   2.0 Date  2010-11-03 (first); 2014-1-9 (last) Author  Changyou Sun   <[email protected]> <[email protected]> Maintainer  Changyou Sun   <[email protected]> <[email protected]> Depends  R (>= 3.0.0), car, erer, urca Description  This package focuses on asymmetric price transmission (APT) between two time seDescription This ries. It contains functions for linear and nonlinear threshold cointegration, and furthermore, symmetric and asymmetric error correction model. License   GPL LazyLoad   yes NeedsCompilation   no Repository   CRAN Date/Publication 2014-01-10 Date/Publication  2014-01-10 17:27:02

R

topics documented: apt-package . . . ciTarFit . . . . . ciTarLag . . . . . ciTarThd . . . . . daVich . . . . . . ecmAsyFit . . . . ecmAsyTest . . . ecmDiag . . . . . ecmSymFit . . . print.ecm . . . . summary.ciTarFit summary.ecm . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . . 1

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

                       

2 2 4 6 7 10 12 14 15 16 17 18

 

2

 

ciTarFit   

Index

 

apt-package

19

Asymmetric Price Transmission Transmission

Description This package package focuses on asym asymmetr metric ic price transm transmissi ission on between two time series. The name of  functions and datasets reveals reveals the categories they belong to. A prefix of  da  is for datasets,  ci  for cointegration, cointegrat ion, and  ecm  for error correction model. This package focuses on the price transmission between  two  price variables. Therefore, objectives like fitting an error correction model for more than two variables are beyond the scope of this package. Details Package: Type: Version: Date Date:: Depend Dep ends: s: License: Lazy LazyLo Load ad::

apt Package 2.0 20 2010 10-1 -111-03 03 (fi (firs rstt buil built) t);; 20 2014 14-1 -1-9 -9 (l (las ast) t) R (>= 3.0 3.0.0) .0),, car, car, ere ererr, urc urcaa GPL ye yess

Author(s) Changyou Sun <csun@cfr <[email protected]> .msstate.edu>

ciTarFit

 

Fitting Threshold Cointegration

Description Fit a threshold cointegration regression between two time series. Usage ciTarF ciT arFit( it(y, y, x, mod model el = c(" c("tar tar", ", "mt "mtar" ar"), ), lag lag, , thr thresh esh, , small.win, small .win, ...)

 

 

ciTarFit 

3

Arguments y

 

dependent or left-side variable for the long-run model.

x

 

independent or right-side variable for the long-run model.  

model lag

a choice of two models: tar or mtar mtar..

 

number of lags for the threshold cointegrati cointegration on regression. a threshold value.

 

thresh

 

small.win

 

...

value of a small window for fitting the threshold cointegrat cointegration ion regression regression.. additional arguments to be passed.

Details This is the main function for threshold autoregression regression (TAR) in assessing the nonlinear threshold relation between two time series variables. It can be used to estimate four types of threshold cointegration regressions. These four types are TAR with a threshold value of zero; consistent TAR with a nonzero threshold; MTAR (momentum TAR) with a threshold value of zero; and consistent sist ent MT MTAR AR with a nonzero nonzero thresol thresold. d. The option of smal smalll window window is used in mode modell selectio selection n because a comparison of AIC and BIC values should be based on the same number of regression observations. Value Return a list object of class "ciTarFit" with the following components: y

 

dependend variable

x

 

independent variable  

model

model choice

 

lag

number of lags  

thresh

threshold value

data.LR

 

data used in the long-run regression

data.CI

 

data used in the threshold cointegrat cointegration ion regression

z lz

 

residual from the long-run regression  

lagged residual from the long-run regression  

ldz

lagged residual with 1st difference difference from long-run model

LR

 

long-run regression

CI

 

threshold cointegrat cointegration ion regression

f.phi

 

test with the null hypothesis of no threshold cointegrat cointegration ion

f.apt

 

test with the null hypothesis of no asymmetric price transmission in the long run

sse

 

value of sum of squared errors

aic

 

value of Akaike Information Criterion

bic

 

value of Bayesian Information Criterion.

 

4

 

ciTarLag 

Methods One method is defined as follows: print:  Four main outputs from threshold cointegration regression are shown: long-run regression

between the two price variables, threshold cointegrat cointegration ion regression, hypothesis test of no cointegration, and hypothesis of no asymmetric adjustment. Author(s) Changyou Sun (<[email protected]>) References Balke, N.S., and T. Fomby Balke, Fomby.. 1997 1997.. Thres Threshold hold co cointe integrat gration. ion. Inte Internat rnational ional Econom Economic ic Re Revie view w 38(3):62 38(3 ):627-645 7-645.. Enders, Enders, W., and C.W C.W.J. .J. Granger Granger. 1998. Unit Unit-roo -roott tests and asymm asymmetri etricc adjustment with an example using the term structure of interest interest rates. Journal of Business & Economic Statistics 16(3):304-311. Enders, Ende rs, W., and P.L. Siklos. 2001. Coint Cointegra egration tion and thresho threshold ld adjustm adjustment. ent. Journ Journal al of Business Business and Economic Statistics 19(2):166-176. See Also summary.ciTarFit;  ciTarLag for lag selection; and  ciTarThd for threshold selection.

Examples # see examp example le at daV daVich ich

 

ciTarLag

Lag Selection for Threshold Cointegration Regr Regression ession

Description Select the best lag for threshold cointegration regression by AIC and BIC Usage ciTarL ciT arLag( ag(y, y, x, mod model el = c(" c("tar tar", ", "mt "mtar" ar"), ), max maxlag lag, , thr thresh esh, , adjust adj ust = TRU TRUE, E, ... ...) )

Arguments y

 

dependent or left-side variable for the long-run regression regression..

x

 

independent or right-side variable for the long-run regression regression..

model maxlag

 

a choice of two models, either tar or mtar. mtar.  

maximum number of lags allowed in the search process.

 

 

ciTarLag 

5

thresh

 

a threshold value.

adjust

 

logical value (default of TRUE) of whether to adjust the window widths so all regressions by lag have the same number of observations

 

...

additional arguments to be passed.

Details Estimate the threshold cointegration regressions by lag and then select the best regression by AIC or BIC value. The longer the lag, the smaller the number of observations availabe availabe for estimation. If the windows of regressions by lag are not ajusted, the maximum lag is usually the best lag by AIC or BIC. Theorectially, AIC and BIC from different models should be compared on the basis of the same observation numbers (Ender 2004).  adjust  shows the effect of this adjustment on the estimation window. By default, the value of  adjust  adjust should be TRUE. Value Return a list object of class "ciTarLag" with the following components:  

path

 

out

a data frame of model criterion values by lag, including lag  for the current lag, totObs  for total observations in the raw data,   coinObs  for observations used in the cointegration regression,  sse  for the sum of squared errors,  aic  for AIC value,  bic  for BIC value,  LB4  for the p-value of Ljung_Box Q statistic with 4 autocorrelation autocorrelati on coefficie coefficients, nts, LB8  with 8 coefficients,  LB12 for Q statistic with 12 coefficients a data frame of the final model selection, including the values of model, maximum lag, threshold value, best lag by AIC, best lag by BIC

Methods One method is defined as follows: plot:  This demonstrates the trend of AIC and BIC changes of threshold cointegration regressions

by lag. It facilitates the selection of the best lag for a threshold cointegration model. Author(s) Changyou Sun (<[email protected]>) References Enders, W. 2004. Applied Econometric Time Series. John Wiley & Sons, Inc., New York. 480 P. Enders, W., and C.W.J. Granger. 1998. Unit-root tests and asymmetric adjustment with an example using the term structure of interest rates. Journal of Business & Economic Statistics 16(3):304-311. See Also ciTarFit;  and  ciTarThd;

 

6

 

ciTarThd 

Examples # see examp example le at daV daVich ich

 

ciTarThd

Threshold Selection for Threshold Cointegration Regr Regression ession

Description Select the best threshold for threshold cointegration regression by sum of squared errors Usage ciTarT ciT arThd( hd(y, y, x, mod model el = c(" c("tar tar", ", "mt "mtar" ar"), ), lag lag, , th. th.ran range ge = 0.1 0.15, 5, di digi gits ts = 3, ...) ...)

Arguments y

 

dependent or left-side variable for the long-run regression regression..

x

 

independent or right-side variable for the long-run regression regression..  

model lag

a choice of two models, either tar or mtar. mtar.

 

number of lags.  

th.range

 

digits ...

the percentage of observati observations ons to be excluded from the search. number of digits used in rounding outputs.

 

additional arguments to be passed.

Details The best threshold is determined by fitting the regression for possible threshold values, sorting the results by sum of squared errors (SSE), and selecting the best with the lowest SSE. To have sufficient observations on either side of the threshold value, certain percentage of observations on the top and bottoms are excluded from the search path. This is usually set as 0.15 by the  th.range (Chan 1993). Value Return a list object of class "ciTarThd" with the following components:  

model lag

model choice

 

number of lags

th.range

 

the percentage of observati observations ons excluded

th.final

 

the best threshold value

ssef

 

the best (i.e., lowest) value of SSE  

obs.tot

 

obs.CI

 

basic path

 

total number of observati observations ons in the raw data number of observati observations ons used in the threshold cointegrat cointegration ion regression a brief summary of the major outputs a data frame of the search record (number of regression, threshold value, SSE, AIC, and BIC values).

 

 

daVich

7

Methods One method is defined as follows: plot:  plotting three graphs in one window; they reveals the relationship between SSE (sum of 

squared errors) squared errors),, AIC, BIC and the thre threshol shold d val values. ues. The best thresho threshold ld value is assoc associated iated with the lowest SSE value. Author(s) Changyou Sun (<[email protected]>) References Chan, K.S. 1993. Consistency and limiting distribution of the least squares estimator of a threshold autoregressive model. The Annals of Statistics 21(1):520-533. Enders, W., and C.W.J. Granger. 1998. Unit-root tests and asymmetric adjustment with an example using the term structure of interest rates. Journal of Business & Economic Statistics 16(3):304-311. See Also ciTarFit;  and  ciTarLag

Examples # see examp example le at daV daVich ich

 

daVich

Import prices and values of wooden beds from Vietnam anc China

Description This data set contains two unit import prices (dollar per piece) and values (million dollars) of  wooden beds from Vietnam and China to the United States. price.vi price.ch price.vi price.ch

       

Monthly price o over ver JJanurary anurary 2002 2002 to Janurary 2010 from Viet Vietnam. nam. Monthly price o over ver JJanurary anurary 2002 2002 to Janurary 2010 from China. Monthly value value ov over er Janurar Janurary y 2002 to Janurary 201 2010 0 from Vietnam. Vietnam. Monthly value over Janurary 2002 to Janurary 2010 from China.

Usage data(daVich)

Format A monthly time series from Janurary 2002 to Janurary 2010 with 97 observations for each of the four series.

 

8

 

daVich

Details Under the Harmonized Tariff Schedule (HTS) system, the commodity of wooden beds is classified as HTS 9403.50.9040. The monthly cost-insurance-freight values in dollar and quantities in piece are reported by country from U.S. ITC (2010). The unit price (dollar per piece) is calculated as the ratio of value over quantity by country. Source U.S. ITC, 2010. Interactive tariff and trade data web.  http://dataweb.usitc.gov  (Assecced on March 1, 2010). References Sun, C. 2011. Price dynamics in the import wooden bed market of the United States. Forest Policy and Economics 13(6): 479-487. Examples # The follo followin wing g cod codes es reprodu reproduce ce the main result results s in Sun (2011 FPE). # All All the the co code des s ha have ve be been en te test sted ed an and d sh shou ould ld wo work rk. . # 1. Data prepar preparation ation _____________ ___________________ ____________ _____________ _____________ ____________ ____________ _____________ ________ _ data(daVich) head(daVich) head(d aVich); ; tail(daVich); tail(daVich); str(daVich) str(daVich) prVi prVi <- y <- daVich daVich[, [, 1] prCh prCh <- x <- daVich daVich[, [, 2]

# 2. EG cointe cointegratio gration n

_____________ ___________________ ____________ _____________ _____________ ____________ ____________ _____________ _______

LR <- lm(y lm(y ~ x); x); su summ mmar ary(L y(LR) R) (LR.coef (LR.co ef <- round( round(summary summary(LR)$c (LR)$coeffic oefficients, ients, 3)) (ry <- ts(residuals ts(residuals(LR), (LR), start=start(pr start=start(prCh), Ch), end=end(prCh), end=end(prCh), frequency frequency =12)) summary(eg summar y(eg <- ur.df(ry ur.df(ry, , type=c type=c("none ("none"), "), lags=1)); lags=1)); plot(eg) (eg4 <- Box.t (eg4 Box.test est(eg (eg@re @res, s, lag = 4, type="Lj type="Ljung ung") ") ) (eg8 (eg 8 <- Box.t Box.test est(eg (eg@re @res, s, lag = 8, type="Lj type="Ljung ung") ") ) (eg12 (eg 12 <- Box.te Box.test( st(eg@ eg@res, res, lag = 12, typ type=" e="Lju Ljung" ng")) ))

## Not Not run: run: # 3. TAR + Cointe Cointegratio gration n

____________ __________________ _____________ _____________ ____________ ____________ ____________ ___________ _____

# bes best t thr thresh eshold old t3 <- ciTarT ciTarThd(y=p hd(y=prVi, rVi, x=prCh, model="tar", model="tar", lag=0) (th.tar (th.ta r <- t3$bas t3$basic); ic); plot(t3) for (i in 1:12) { # 20 seconds t3a <- ciTarT ciTarThd(y=p hd(y=prVi, rVi, x=prCh, x=prCh, model="tar", model="tar", lag=i) th.tar[i+2] th.tar [i+2] <- t3a$basic[,2] t3a$basic[,2]

 

 

daVich

9

} th.tar t4 <- ciTarT ciTarThd(y=p hd(y=prVi, rVi, x=prCh, model="mtar" model="mtar", , lag=0); (th.mtar <- t4$basic) t4$basic) plot(t4) for for (i in 1:12 1:12) ) { t4a <- ciTarT ciTarThd(y=p hd(y=prVi, rVi, x=prCh, x=prCh, model="mtar" model="mtar", , lag=i) th.mtar[i+2] th.mta r[i+2] <- t4a$basic[,2] t4a$basic[,2] } th.mtar t.ta t.tar r <- -8. 8.04 041; 1; t.m t.mta tar r <- -0. -0.45 451 1 # t. t.ta tar r <- -8. 8.70 701 1 ; t.mt t.mtar ar <<- -0 -0.4 .451 51 # lag sel select ection ion mx <- 12 (g1 <-ci <-ciTar TarLag Lag(y= (y=prV prVi, i, (g2 <-ci <-ciTar TarLag Lag(y= (y=prV prVi, i, (g3 <-ciTarLag(y=pr <-ciTarLag(y=prVi, Vi, (g4 <-ciTa <-ciTarLag(y rLag(y=prVi, =prVi,

x=prC x=prCh, h, x=prC x=prCh, h, x=prCh, x=prCh,

# lag lag = 0 to 4 # lag lag = 5 to 1 12 2

model model="t ="tar" ar", , maxlag= maxlag=mx, mx, model model="m ="mtar tar",m ",maxl axlag=m ag=mx, x, model="tar", model="tar", maxlag=mx, model="mtar" model="mtar",maxla ,maxlag=mx, g=mx,

thre thresh= sh= 0)); 0)); thres thresh= h= 0)); 0)); thresh=t.tar thresh=t.tar)); )); thresh=t.mta thresh=t.mtar)); r));

plot(g1 plot(g1) ) plot(g2 plot(g2) ) plot(g3 plot(g3) ) plot(g4) plot(g4)

# Tab Table le 3 Result Results s of EG and threshold threshold cointegra cointegration tion tests # Not Note: e: Som Some e res result ults s in Table Table 3 in the publishe published d pape paper r wer were e inc incorr orrect ect because because # of a mist mistak ake e ma made de when the paper paper was done done in 2009. 2009. I fo foun und d th the e mi mist stak ake e whe when n # the the pack packag age e wa was s bu buil ild d in la late ter r 20 2010 10. . Fo For r ex exam ample ple, , fo for r th the e co cons nsis iste tent nt MT MTAR, AR, # the coef coeffic ficien ient t for the positi positive ve term was reporte reported d as -0.25 -0.251 1 (-2.13 (-2.130) 0) but # it shoul should d be -0. -0.106 106 (-0.764 (-0.764), ), as cac caclua luated ted from below below codes. # The main conc conclus lusion ion about the research research issu issue e is still qualitat qualitative ively ly the same same. . vv <- 3 (f1 (f1 <- ciTa ciTarF rFit it(y (y=p =prV rVi, i, x=p x=prC rCh, h, mod model el=" ="ta tar" r", , la lag=v g=vv, v, thr thres esh= h=0 0 )) (f2 <- ciTarF ciTarFit( it(y=p y=prVi rVi, , x=p x=prCh rCh, , mod model= el="ta "tar", r", lag lag=vv, =vv, thresh thresh=t. =t.tar tar )) (f3 (f3 <- ciT ciTar arFi Fit( t(y= y=pr prVi Vi, , x=prCh x=prCh, , model model=" ="mt mtar ar", ", lag=v lag=vv, v, thre thresh sh=0 =0 )) (f4 <- ciTarFit(y=p ciTarFit(y=prVi, rVi, x=prCh, x=prCh, model="mtar" model="mtar", , lag=vv, thresh=t.mtar)) thresh=t.mtar)) r0 <- cbind( cbind(summar summary(f1)$d y(f1)$dia, ia, summary(f2)$ summary(f2)$dia, dia, summary(f3)$d summary(f3)$dia, ia, summary(f4)$dia) diag dia g <- r0[c(1 r0[c(1:4, :4, 6:7, 12:14, 12:14, 8, 9, 11), 11), c(1 c(1,2, ,2,4,6, 4,6,8)] 8)] rownames(dia rownam es(diag) g) <- 1:nrow(diag); 1:nrow(diag); diag e1 <- summar summary(f1)$ y(f1)$out; out; e2 <- summary(f2)$ summary(f2)$out out e3 <- sum summar mary(f y(f3)$ 3)$out out; ; e4 <- summar summary(f y(f4)$ 4)$out out; ; rbi rbind(e nd(e1, 1, e2, e3, e4) ee <- list list(e (e1, 1, e2 e2, , e3 e3, , e4) e4); ; ve vect ct <- NU NULL LL for (i in 1:4) { ef <- data.f data.frame(e rame(ee[i]) e[i]) vect2 <- c(paste(ef[3, c(paste(ef[3, "estimate"], "estimate"], ef[3, "sign"], sep=""), sep=""), past paste( e("( "(", ", ef[3 ef[3, , "t.v "t.val alue ue"] "], , ")", ")", sep= sep="" ""), ), paste(ef[4, paste( ef[4, "estimate"], "estimate"], ef[4, "sign"], "sign"], sep=""), sep=""), past paste( e("( "(", ", ef[4 ef[4, , "t.v "t.val alue ue"] "], , ")", ")", sep= sep="" "")) )) vect vec t <- cbind( cbind(vec vect, t, vect2) vect2) } item <- c("pos c("pos.coeff .coeff","pos. ","pos.t.valu t.value", e", "neg.coeff", "neg.coeff","neg.t. "neg.t.value" value") ) ve <- data.f data.frame(c rame(cbind(it bind(item, em, vect)); vect)); colnames(ve) colnames(ve) <- colnames(dia colnames(diag) g)

 

10

 

ecmAsyFit 

( res res.CI .CI <- rbind( rbind(dia diag, g, ve)[c( ve)[c(1:2 1:2, , 13: 13:16, 16, 3:12), ] ) rownames(res rownam es(res.CI) .CI) <- 1:nrow(res.CI 1:nrow(res.CI) )

# 4. APT + ECM

______ _____________ _____________ ____________ ____________ _____________ _____________ ____________ ____________ _____________ _______

(sem <- ecmSymFit(y= ecmSymFit(y=prVi, prVi, x=prCh, lag=4)); lag=4)); names(sem) names(sem) aem <- ecmAsyFit(y= ecmAsyFit(y=prVi, prVi, x=prCh,lag=4 x=prCh,lag=4, , model="mtar", model="mtar", split=TRUE, split=TRUE, thresh=t.mtar thresh=t.mtar) ) aem (ccc <- summary(aem) summary(aem)) ) coe <- cbind(as.cha cbind(as.character( racter(ccc[1: ccc[1:19, 19, 2]), paste(ccc[1: paste( ccc[1:19, 19, "estimate"], "estimate"], ccc$signif[1 ccc$signif[1:19], :19], sep=""), sep=""), ccc[1:19, ccc[1:19, "t.value"], "t.value"], paste(ccc[20:38,"estimate"], ccc$signif[20:38],sep=""), ccc[20:38,"t.value"]) colnames(coe colnam es(coe) ) <- c("item", c("item", "China "China.est", .est", "China.t", "China.t", "Vietnam.est "Vietnam.est","Vie ","Vietnam.t tnam.t") ") (edia <- ecmDia (edia ecmDiag(a g(aem, em, 3)) (ed <- edia[c(1,6,7 edia[c(1,6,7,8,9), ,8,9), ]) ed2 <- cbind( cbind(ed[ ed[,1: ,1:2], 2], "_", ed[,3] ed[,3], , "_" "_") ) colnames(ed2 colnam es(ed2) ) <- colnames(coe) colnames(coe) (tes <- ecmAsy ecmAsyTest(a Test(aem)$out em)$out) ) (tes2 <- tes[c( tes[c(2,3,5, 2,3,5,11,12,1 11,12,13,1), 3,1), -1]) tes3 <- cbind( cbind(as.cha as.character( racter(tes2[, tes2[,1]), 1]), paste(tes2[, paste( tes2[,2], 2], tes2[,6], tes2[,6], sep= ), paste( paste("[", "[", round(tes2[,4],2), round(tes2[,4],2), "]", sep= paste(tes2[, paste( tes2[,3], 3], tes2[,7], tes2[,7], sep= ), paste( paste("[", "[", round(tes2[,5],2), round(tes2[,5],2), "]", sep= colnames(tes colnam es(tes3) 3) <- colnames(coe) colnames(coe)







(coe <- data.frame( data.frame(apply(c apply(coe, oe, 2, as.character as.character), ), stringsAsFactors=F stringsAsFactors=FALSE)) ALSE)) (ed2 <- data.frame( data.frame(apply(e apply(ed2, d2, 2, as.character as.character), ), stringsAsFactors=F stringsAsFactors=FALSE)) ALSE)) (tes3 <- data.f data.frame(a rame(apply(te pply(tes3,2, s3,2, as.character as.character), ), stringsAsFact stringsAsFactors=FA ors=FALSE)) LSE)) table.4 table. 4 <- data.f data.frame(r rame(rbind(co bind(coe, e, ed2, tes3)) options(widt option s(width=150) h=150); ; table.4; table.4; options(widt options(width=80) h=80)

## End(No End(Not t run run) )

ecmAsyFit

 

), ))



Fitting Asymmetric Error Correction Model

Description Estimate an asymmetric error correction model (ECM) for two time series. Usage ecmA ecmAsy syFi Fit( t(y, y, x, lag lag = 1, spli split t = TRUE TRUE, , model = c("li c("linear" near", , "tar "tar", ", "mta "mtar"), r"), thresh, ...)

 

 

ecmAsyFit 

11

Arguments y

 

dependent or left-side variable for the long-run regression regression..

x

 

independent or right-side variable for the long-run regression regression..  

lag

number of lags for variable variabless on the right side.

split

 

a logical value (default of TRUE) of whether the right-hand variables should be split into positive and negative parts.

model

 

a choice of three models: linear linear,, tar , or mtar cointegrat cointegration. ion.  

thresh

 

...

a thresh threshold old val value; ue; this is only requi required red when the mode modell iiss sspeci pecified fied as ’ta ’tar’ r’ or ’mtar.’ additional arguments to be passed.

Details There are two specficiations of an asymmetric ECM. The first one is how to calculate the error correcti corr ection on terms. One way is through linear two-s two-step tep Engle Granger approa approach, ch, as speci specificied ficied by model="linear". The other two ways are threshold threshold cointeg cointegrati ration on by eithe eitherr ’tar’ or ’mtar’ with a threshold value. value. The second specification is related to the possible asymmetric price transmi transmission ssion in the lagged price variables, as specified in   spl split = TRUE TRUE. Note that the linear cointegration specification is a special case of the threshold cointegration. A model with  model="linear"  is the same as a model with   mode model=" l="tar tar", ", thr thresh esh = 0. Value Return a list object of class "ecm" and "ecmAsyFit" with the following components: y

 

dependend variable

x

 

independent variable

lag

 

number of lags

split

 

logical value of whether the right-hand variables are split

model

 

model choice

IndVar

 

data frame of the right-hand variables used in the ECM

name.x

 

name of the independent variable

name.y

 

name of the dependent variable

ecm.y

 

ECM regression for the dependent variable

ecm.x

 

ECM regression for the independent variable

data thresh

 

all the data combined for the ECM  

thresh value for TAR and MT MTAR AR model

Methods Two methods are defined as follows: print:  showing the key outputs. summary:  summarizing thekey outputs.

 

12

 

ecmAsyTest 

Author(s) Changyou Sun (<[email protected]>)

References Enders, W., and C.W.J. Granger. 1998. Unit-root tests and asymmetric adjustment with an example using the term structure of interest rates. Journal of Business & Economic Statistics 16(3):304-311.

See Also print.ecm;  summary.ecm;  ecmDiag;  and  ecmAsyTest.

Examples # see examp example le at daV daVich ich

 

ecmAsyTest

Hypothesis Tests on Asymmetric Error Correction Model

Description Conduct several F-tests on the coefficients from asymmetric ECM.

Usage ecmAsy ecm AsyTes Test(w t(w, , dig digits its = 3, ... ...) )

Arguments w

 

an object of ’ecmAsyFit’ class.  

digits ...

 

number of digits used in rounding outputs. additional arguments to be passed.

Details There are two ECM equati There equations ons for the tw two o price price series series.. In eac each h equati equation, on, four four types types of hyp hypoth othese esess are tested; equilibrium adjustment path symmetry on the error correction terms (H1), Granger causality test (H2), distributed lag symmetry at each lag (H3), and cumulative asymmetry of all lags (H4). The latter two tests are only feasible and availabe availabe for models with split variables. The number of  H3 tests is equal to the number of lags.

 

 

ecmAsyTest 

13

Value Return a list object with the following components: H1ex

 

H01 in equation x: equilibrium adjustment path symmetry

H1ey H2xx

   

H01 in equation y: equilibrium adjustment path symmetry H02 in equation x: x does not Granger cause x

H2yx

 

H02 in equation y: x does not Granger cause y

H2xy

 

H02 in equation x: y does not Granger cause x

H2yy

 

H02 in equation y: y does not Granger cause y

H3xx

 

H03 in equation x: distribute distributed d lag symmetry of x at each lag

H3yx

 

H03 in equation y: distribute distributed d lag symmetry of x at each lag

H3xy

 

H03 in equation x: distribute distributed d lag symmetry of y at each lag

H3yy

 

H03 in equation y: distribute distributed d lag symmetry of y at each lag

H4xx

 

H04 in equation x: cumulati cumulative ve asymmetry of x for all lags

H4yx

 

H04 in equation y: cumulati cumulative ve asymmetry of x for all lags

H4xy

 

H04 in equation x: cumulati cumulative ve asymmetry of y for all lags

H4yy

 

H04 in equation y: cumulati cumulative ve asymmetry of y for all lags

out

 

summary of the four types of hypothesis tests

Author(s) Changyou Sun (<[email protected]>)

References Frey, G., and M. Manera. 2007. Econometric models of asymmetric price transmission. Journal of  Economic Surveys 21(2):349-415.

See Also ecmAsyFit and  ecmDiag.

Examples # see examp example le at daV daVich ich

 

14

 

 

ecmDiag

ecmDiag 

Diagnostic Statitics for Symmetric or Asymmetric ECMs

Description Report a set of diagnostic statistics for symmetric or asymmetric error correction models Usage ecmDia ecm Diag(m g(m, , dig digits its = 2, ... ...) )

Arguments m

 

an object of class ecm  from the function of  ecmAsyFit  ecmAsyFit or  ecmSymFit.  

digits ...

 

number of digits used in rounding outputs. additional arguments to be passed.

Details Compute sever Compute several al diagnost diagnostic ic statist statistics ics for each ECM equat equation. ion. This is main mainly ly used to assess the serial correlation in the residuals and model adequacy. Value Return a data frame object with the foll Return followin owing g comp component onentss by equation equation:: R-sq R-squared uared,, Adjusted Adjusted Rsquared, F-statistic, Durbin Watson statistic, p-value for DW statistic, AIC, BIC, and p-value of  Ljung_Box Q statistics with 4, 8, 12 autocorrelation coefficients. Author(s) Changyou Sun (<[email protected]>) References Enders, W. 2004. Applied Econometric Time Series. John Wiley & Sons, Inc., New York. 480 P. See Also ecmAsyFit;  ecmSymFit;  and  ecmDiag.

Examples # see examp example le at daV daVich ich

 

 

ecmSymFit 

 

ecmSymFit

15

Fitting symmetric Error Correction Model

Description Estimate a symmetric error correction model (ECM) for two time series. Usage ecmSym ecm SymFit Fit(y, (y, x, lag = 1, ... ...) )

Arguments y

 

dependent or left-side variable for the long-run regression regression..

x

 

independent or right-side variable for the long-run regression regression..

lag

 

number of lags for variable variabless on the right side.

...

 

additional arguments to be passed.

Details The package   apt   focuses focuses on pric pricee tran transmis smission sion betwee between n two series series.. This function function estimates estimates a standard error correcti standard correction on model for two time seri series. es. Whil Whilee it can be extended extended for more than two series, it is beyond the objective of the package now. Value Return a list object of class "ecm" and "ecmSymFit" with the following components: y

 

dependend variable

x

 

independent variable

lag data

 

number of lags  

all the data combined for the ECM

IndVar name.x

   

data frame of the right-hand variables used in the ECM name of the independent variable

name.y

 

name of the dependent variable

ecm.y

 

ECM regression for the dependent variable

ecm.x

 

ECM regression for the independent variable

Author(s) Changyou Sun (<[email protected]>) References Enders, W. 2004. Applied Econometric Time Series. John Wiley & Sons, Inc., New York. 480 P.

 

16

 

print.ecm 

See Also print.ecm;  summary.ecm;  ecmDiag;  and  ecmAsyFit.

Examples # see examp example le at daV daVich ich

 

print.ecm

Printing Outputs from Error Correction Models

Description Show main outputs from symmetric  ecmSymFit or asymmetric  ecmAsyFit error correction models. Usage ## S3 method method for cla class ss print(x, prin t(x, ...)

ecm

  



Arguments x ...

 

an object of class ecm  from the function of  ecmAsyFit  ecmAsyFit or  ecmSymFit.  

additional arguments to be passed.

Details This is the print method for  ecmAsyFit or  ecmSymFit  to show main model outputs. Value Summary results of the two ECM equations are shown for the two focal price series. Author(s) Changyou Sun (<[email protected]>) See Also ecmSymFit and  ecmAsyFit.

Examples # see examp example le at daV daVich ich

 

 

summary.ciTarFit 

summary.ciTarFit

 

17

Summary of Results from Threshold Cointegration Regr Regression ession

Description This summarizes the main results from threshold cointegration regression.

Usage ## S3 method method for cla class ss ciTarFit summary(o summ ary(object bject, , digit digits=3, s=3, ...)   



Arguments object

 

an object of class ’ciTarFit’. ’ciTarFit’.

digits

 

number of digits for rounding outputs.

...

 

additional arguments to be passed.

Details This wraps up the outputs from threshold cointegration regression in two data frames, one for diagnostic statistics and the other for coeffients.

Value A list with two data frames.  dia  contains the main model specifications and hypothesis test results. out contains the regression results for both the long run (LR) and threshold cointegration (CI).

Author(s) Changyou Sun (<[email protected]>)

See Also ciTarFit.

Examples # see examp example le at daV daVich ich

 

18

 

 

summary.ecm

summary.ecm 

Summary of Results from Error Correction Model

Description This summarizes the main results from error correction models. Usage ## S3 method method for cla class ss ecm summary(o summ ary(object bject, , digit digits=3, s=3, ...)   



Arguments object

 

an object of class ecm  from the function of  ecmAsyFit  ecmAsyFit or  ecmSymFit.

digits

 

number of digits for rounding outputs

...

 

additional arguments to be passed.

Details This wraps up the coefficents and statistics from ECM by equation. Value A data frame object with coefficients and related statistics by equation. Author(s) Changyou Sun (<[email protected]>) See Also ecmSymFit and  ecmAsyFit.

Examples # see examp example le at daV daVich ich

 

Index Topic  datasets daVich,  7 ∗Topic  methods print.ecm,  16 ∗

summary.ciTarFit,  17 summary.ecm, 18

Topic  package



apt-package, 2

Topic  regression ciTarFit,  2 ciTarLag,  4



ciTarThd,  6 ecmAsyFit,  10 ecmAsyTest,  12 ecmDiag,  14 ecmSymFit,  15 apt ( apt-package),  2 apt-package,  2 ciTarFit,  2,  2 ,  5 ,  7 ,  17  ciTarLag,  4 ,  4,  4 ,  7  ciTarThd,  4 ,  4 , 5  5 ,  6 daVich,  7 ecmAsyFit,  10  10,,  13  13 , , 14  14 ,  16 ,  18  ecmAsyTest,  12 ,  12 ecmDiag,  12 –   12 – 1 14 4,  14,  14 ,  16  ,  14 ,  15  15, ,  16 ,  18  ecmSymFit plot.ciTarLag ( ciTarLag),  4 plot.ciTarThd ( ciTarThd),  6 print.ciTarFit ( ciTarFit),  2 print.ecm,  12 ,  16 , 16 summary.ciTarFit,  4 ,  17 summary.ecm,  12 ,  16 ,  18

19

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close