Title: | Perform Global Vector Autoregression Estimation and Inference |
---|---|
Description: | Light procedures for learning Global Vector Autoregression model (GVAR) of Pesaran, Schuermann and Weiner (2004) <DOI:10.1198/073500104000000019> and Dees, di Mauro, Pesaran and Smith (2007) <DOI:10.1002/jae.932>. |
Authors: | Ho Tsung-wu |
Maintainer: | Ho Tsung-wu <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.4 |
Built: | 2024-11-24 06:45:16 UTC |
Source: | CRAN |
Average pairwise cross-section residual correlations.
averageCORgvar(out)
averageCORgvar(out)
out |
Estimation results object generated by GVARest |
This function compares the dependency of residuals in VAR and GVAR.
varRSDcor |
A list object of average residual correlations of country-specific VAR |
gvarRSDcor |
A list object of average residual correlations of country-specific VAR augmented by foreign variables(GVAR) |
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University.
Mauro Filippo di and Pesaran H. M. (2013) The GVAR Handbook– Structure and Applications of a Macro Model of the Global Economy for Policy. Oxford University Press.
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) cor2_avg=averageCORgvar(out=mainOUTPUT) as.matrix((cor2_avg$varRSDcor)[[1]]) as.matrix((cor2_avg$varRSDcor)[[2]]) as.matrix(cor2_avg$gvarRSDcor[[1]]) as.matrix(cor2_avg$gvarRSDcor[[2]])
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) cor2_avg=averageCORgvar(out=mainOUTPUT) as.matrix((cor2_avg$varRSDcor)[[1]]) as.matrix((cor2_avg$varRSDcor)[[2]]) as.matrix(cor2_avg$gvarRSDcor[[1]]) as.matrix(cor2_avg$gvarRSDcor[[2]])
Average pairwise cross-section residual correlations of GVECM and VECM.
averageCORgvecm(out)
averageCORgvecm(out)
out |
Estimation results object generated by GVECMest |
This function compares the dependency of residuals in VAR and GVAR.
vecmRSDcor |
A list object of average residual correlations of country-specific VECM |
gvecmRSDcor |
A list object of average residual correlations of country-specific VECM augmented by foreign variables(GVECM) |
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University.
Mauro Filippo di and Pesaran H. M. (2013) The GVAR Handbook– Structure and Applications of a Macro Model of the Global Economy for Policy. Oxford University Press.
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVECMest(data=PriceVol,p,lag.max,type,ic,weight.matrix) cor2_avg=averageCORgvecm(out=mainOUTPUT) as.matrix((cor2_avg$vecmRSDcor)[[1]]) as.matrix((cor2_avg$vecmRSDcor)[[2]]) as.matrix(cor2_avg$gvecmRSDcor[[1]]) as.matrix(cor2_avg$gvecmRSDcor[[2]])
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVECMest(data=PriceVol,p,lag.max,type,ic,weight.matrix) cor2_avg=averageCORgvecm(out=mainOUTPUT) as.matrix((cor2_avg$vecmRSDcor)[[1]]) as.matrix((cor2_avg$vecmRSDcor)[[2]]) as.matrix(cor2_avg$gvecmRSDcor[[1]]) as.matrix(cor2_avg$gvecmRSDcor[[2]])
Extract country-specific standard LS coefficient estimates.
getCOEF(out,sheet)
getCOEF(out,sheet)
out |
A list object of estimation results generated by GVARest() |
sheet |
The number of country in out file |
Extract country-specific standard LS coefficient estimates.
coef |
Country-specific coefficient estimates |
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University.
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) COEF=getCOEF(out=mainOUTPUT,sheet=1)
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) COEF=getCOEF(out=mainOUTPUT,sheet=1)
Extract all-country LS coefficient estimates.
getCOEFexo(out)
getCOEFexo(out)
out |
A list object of estimation results generated by GVARest(). |
Extract all-country LS coefficient estimates.
coef |
Country-specific coefficient estimates. |
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University.
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) #COEF=getCOEFexo(out=mainOUTPUT)
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) #COEF=getCOEFexo(out=mainOUTPUT)
Extract country-specific LS coefficient estimates with Newy-West robust covariance.
getNWCOEF(out,sheet)
getNWCOEF(out,sheet)
out |
A list object of estimation results generated by GVARest. |
sheet |
The number of country in out that is to be saved. |
coef |
Country-specific coefficient estimates. |
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University.
Newey WK and West KD (1994) Automatic Lag Selection in Covariance Matrix Estimation. Review of Economic Studies,61,631-653.
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) COEF=getNWCOEF(out=mainOUTPUT,sheet=1)
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) COEF=getNWCOEF(out=mainOUTPUT,sheet=1)
Extract all-country coefficient estimates with Newy-West robust covariance.
getNWCOEFexo(out)
getNWCOEFexo(out)
out |
A list object of estimation results generated by GVARest. |
coef |
Country-specific coefficient estimates. |
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University.
Newey WK and West KD (1994) Automatic Lag Selection in Covariance Matrix Estimation. Review of Economic Studies, 61, 631-653.
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) COEF=getNWCOEFexo(out=mainOUTPUT)
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) COEF=getNWCOEFexo(out=mainOUTPUT)
Extract country-specific LS coefficient estimates with White robust covariance.
getWhiteCOEF(out,sheet)
getWhiteCOEF(out,sheet)
out |
A list object of estimation results generated by GVARest. |
sheet |
The number of country in out that is to be saved. |
coef |
Country-specific coefficient estimates. |
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University.
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) COEF=getWhiteCOEF(out=mainOUTPUT,sheet=1)
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) COEF=getWhiteCOEF(out=mainOUTPUT,sheet=1)
Extract all-country coefficient estimates with Newy-West robust covariance, and save them in a .csv file.
getWhiteCOEFexo(out)
getWhiteCOEFexo(out)
out |
A list object of estimation results generated by GVARest. |
coef |
Country-specific coefficient estimates. |
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University.
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) COEF=getWhiteCOEFexo(out=mainOUTPUT)
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) COEF=getWhiteCOEFexo(out=mainOUTPUT)
Function to generate foreign variables
GVAR_Ft(data, weight.matrix=NULL)
GVAR_Ft(data, weight.matrix=NULL)
data |
Dataframe is a strictly balanced panel data format,the first column is cross-section ID,and the second column is Time. For the sake of identification, both columns must be named by, respectively, id and Time. |
weight.matrix |
Bilateral trade weight matrix for computing foreign variables. If the computation of foreign variables are weighted by one weighting matrix, weight.matrix must be a "data.frame". If the computation of foreign variables are weighted on a year-to-year basis, then weight.matrix must be a "list", with the same length as the weighting frequency. If NULL, then it computes the foreign vriables by average. |
Ft |
Weighted foerign variables as described in GVAR |
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University.
Mauro Filippo di and Pesaran H. M. (2013) The GVAR Handbook– Structure and Applications of a Macro Model of the Global Economy for Policy. Oxford University Press.
#=== Loading Data ===# data("PriceVol") data("tradeweight1") data("tradeweightx") #Generate country-specific foreign variables Ft=GVAR_Ft(data=PriceVol,weight.matrix=tradeweight1) k=17 head(Ft[[k]]) tail(Ft[[k]])
#=== Loading Data ===# data("PriceVol") data("tradeweight1") data("tradeweightx") #Generate country-specific foreign variables Ft=GVAR_Ft(data=PriceVol,weight.matrix=tradeweight1) k=17 head(Ft[[k]]) tail(Ft[[k]])
Compute the structural coefficients matrices G0, G1, G2, and F1, F2
GVAR_GF(data,p, type="const",ic="AIC",weight.matrix)
GVAR_GF(data,p, type="const",ic="AIC",weight.matrix)
data |
Dataframe is a strictly balanced panel data format,the first column is cross-section ID,and the second column is Time. For the sake of identification, both columns must be named by, respectively, id and Time. |
p |
The number of lag for Xt matrix. The number of lag for foreign variables in country-specific VAR FLag is set to be p+1. Current version restricts p <= 2 for simplicity, which aims at avoiding too many paramaters in low-frequency data of many variables and many countries. It will be relaxed soon. |
type |
Model specificaiton for VAR. As in package vars, we have four selection: "none","const","trend", "both". |
ic |
Information criteria for optimal lag.As in package vars, we have four selection: "AIC", "HQ", "SC", "FPE". |
weight.matrix |
Bilateral trade weight matrix for computing foreign variables. If the computation of foreign variables are weighted by one weighting matrix, weight.matrix must be a "data.frame". If the computation of foreign variables are weighted on a year-to-year basis, then weight.matrix must be a "list", with the same length as the weighting frequency. |
This function generates several structural coefficient matrices of Eq.(2.6) in Filippo and Pesaran(2013, P.17), which are required to compute IRF and multistep forecasts. Besides, it also re-calculates the transformed residuals. In this version, we do not include the impulse responses function(IRF), because the IRF can be computed by these matrices and residuals easily. We will not update it until the next version.
G0 |
Matrix G0 of Eq.(2.6) in Filippo and Pesaran(2013, P.17) |
G1 |
Matrix G1 of Eq.(2.6) in Filippo and Pesaran(2013, P.17) |
G2 |
Matrix G2 of Eq.(2.6) in Filippo and Pesaran(2013, P.17) |
F1 |
Matrix F1 of Eq.(2.6) in Filippo and Pesaran(2013, P.17) |
F2 |
Matrix F2 of Eq.(2.6) in Filippo and Pesaran(2013, P.17) |
lagmatrix |
Country-secific optimal lag number, which must be the same. |
RESID |
original residuals=u in Filippo and Pesaran (2013, P.17) |
newRESID |
New residuals=epsilon in Filippo and Pesaran (2013, P.17) |
fitted |
In-sample fitted values, or conditional mean |
data |
data used |
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University.
Mauro Filippo di and Pesaran H. M. (2013) The GVAR Handbook– Structure and Applications of a Macro Model of the Global Economy for Policy. Oxford University Press.
data("PriceVol") data("tradeweightx") data("tradeweight1") p=2 type="const" ic="SC" Result=GVAR_GF(data=PriceVol,p,type,ic, weight.matrix=tradeweight1) Result$G0 Result$G1 Result$G2 Result$F1 Result$F2 Result$lagmatrix Result$RESID Result$newRESID Result$fitted Result$data #May use forecast::accuracy(Result$fitted[,1], Result$data[,1]) for performance.
data("PriceVol") data("tradeweightx") data("tradeweight1") p=2 type="const" ic="SC" Result=GVAR_GF(data=PriceVol,p,type,ic, weight.matrix=tradeweight1) Result$G0 Result$G1 Result$G2 Result$F1 Result$F2 Result$lagmatrix Result$RESID Result$newRESID Result$fitted Result$data #May use forecast::accuracy(Result$fitted[,1], Result$data[,1]) for performance.
Estimate country-specific VAR in a GVAR setting
GVARest(data,p,lag.max, type="const", ic,weight.matrix=NULL)
GVARest(data,p,lag.max, type="const", ic,weight.matrix=NULL)
data |
Dataframe for bivariate VAR is allowed so far, which is also a strictly balanced panel data format,the first column is cross-section ID,and the second column is Time. For the sake of identification, both columns must be named by, respectively, id and Time. Restriction of bivariate VAR will be relaxed soon. |
p |
The number of lag for Xt matrix, foreign variables are set by FLag=p+1. Current version restricts p <= 2 with a view to avoiding too many paramaters in low-frequency data of many variables and many countries. It will be relaxed soon. |
lag.max |
The maximal number of lag for estimating country-specific VAR |
type |
Model specificaiton for VAR. As in package |
ic |
Information criteria for optimal lag.As in package |
weight.matrix |
Bilateral trade weight matrix for computing foreign variables. If the computation of foreign variables are weighted by one weighting matrix, weight.matrix must be a "data.frame". If the computation of foreign variables are weighted on a year-to-year basis, then weight.matrix must be a "list, with the same length as the weighting frequency. |
gvar |
Country-specific GVAR output list |
White |
Coefficient estimates with White robust covariance |
NWHAC |
Coefficient estimates withNewy-West robust covariance |
p |
Number of lags for endogeneous variables in VAR |
K |
Number of lags for Ft variables in VAR |
type |
Model specificaiton. As in package |
datamat |
input data=data |
lagmatrix |
GVAR's Country-secific optimal lag number. |
lagmatrix1 |
VAR's Country-secific optimal lag number. |
exoLag |
Ft lags |
Ft |
Foreign variables |
NAMES |
Names of countries |
gvarRSD |
Country-specific GVAR residuals |
varRSD |
VAR residuals |
weight |
weight.matrix |
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University.
Mauro Filippo di and Pesaran H. M. (2013) The GVAR Handbook– Structure and Applications of a Macro Model of the Global Economy for Policy. Oxford University Press.
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) mainOUTPUT$lagmatrix # Country-specific GVAR lags mainOUTPUT$gvar mainOUTPUT$gvar[[1]] coef(mainOUTPUT$gvar[[17]]) mainOUTPUT$White[[17]] mainOUTPUT$NWHAC[[17]][1]
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVARest(data=PriceVol,p,lag.max,type,ic,weight.matrix) mainOUTPUT$lagmatrix # Country-specific GVAR lags mainOUTPUT$gvar mainOUTPUT$gvar[[1]] coef(mainOUTPUT$gvar[[17]]) mainOUTPUT$White[[17]] mainOUTPUT$NWHAC[[17]][1]
Compute the structural coefficients matrices G0, G1, G2, and F1, F2
GVECM_GF(data,p,type="const",ic="AIC",weight.matrix)
GVECM_GF(data,p,type="const",ic="AIC",weight.matrix)
data |
Dataframe is a strictly balanced panel data format,the first column is cross-section ID,and the second column is Time. For the sake of identification, both columns must be named by, respectively, id and Time. |
p |
The number of lag for Xt matrix. The number of lag for foreign variables in country-specific VAR FLag is set to be p+1.Current version restricts p <= 2 for simplicity, which aims at avoiding too many paramaters in low-frequency data of many variables and many countries. It will be relaxed soon. |
type |
Model specificaiton for VAR. As in package vars, we have four selection: "none","const","trend", "both". |
ic |
Information criteria for optimal lag.As in package vars, we have four selection: "AIC", "HQ", "SC", "FPE". |
weight.matrix |
Bilateral trade weight matrix for computing foreign variables. If the computation of foreign variables are weighted by one weighting matrix, weight.matrix must be a "data.frame". If the computation of foreign variables are weighted on a year-to-year basis, then weight.matrix must be a "list", with the same length as the weighting frequency. |
This function generates several structural coefficient matrices of Eq.(2.6) in Filippo and Pesaran(2013, P.17), which are required to compute IRF and multistep forecasts. Besides, it also re-calculates the transformed residuals. In this version, we do not include the impulse responses function(IRF), because the IRF can be computed by these matrices and residuals easily. We will not update it until the next version.
G0 |
Matrix G0 of Eq.(2.6) in Filippo and Pesaran(2013, P.17) |
G1 |
Matrix G1 of Eq.(2.6) in Filippo and Pesaran(2013, P.17) |
G2 |
Matrix G2 of Eq.(2.6) in Filippo and Pesaran(2013, P.17) |
F1 |
Matrix F1 of Eq.(2.6) in Filippo and Pesaran(2013, P.17) |
F2 |
Matrix F2 of Eq.(2.6) in Filippo and Pesaran(2013, P.17) |
lagmatrix |
Country-secific optimal lag number. |
newRESID |
New residuals=epsilon in Filippo and Pesaran (2013, P.17) |
fitted |
In-sample fitted values, or conditional mean |
data |
data used |
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University.
Mauro Filippo di and Pesaran H. M. (2013) The GVAR Handbook– Structure and Applications of a Macro Model of the Global Economy for Policy. Oxford University Press.
data("PriceVol") data("tradeweightx") data("tradeweight1") p=2 type="const" ic="SC" Result.vecm=GVECM_GF(data=PriceVol,p,type,ic, weight.matrix=tradeweight1) Result.vecm$G0 Result.vecm$G1 Result.vecm$F1 Result.vecm$G2 Result.vecm$F2 Result.vecm$lagmatrix Result.vecm$newRESID Result.vecm$fitted Result.vecm$data
data("PriceVol") data("tradeweightx") data("tradeweight1") p=2 type="const" ic="SC" Result.vecm=GVECM_GF(data=PriceVol,p,type,ic, weight.matrix=tradeweight1) Result.vecm$G0 Result.vecm$G1 Result.vecm$F1 Result.vecm$G2 Result.vecm$F2 Result.vecm$lagmatrix Result.vecm$newRESID Result.vecm$fitted Result.vecm$data
Estimate country-specific Johansen test results in a Global VECM setting
GVECM.jo(data,p=2,ecdet = "const", type = "eigen",spec = "longrun", season = NULL,weight.matrix)
GVECM.jo(data,p=2,ecdet = "const", type = "eigen",spec = "longrun", season = NULL,weight.matrix)
data |
Dataframe is a strictly balanced panel data format,the first column is cross-section ID,and the second column is Time. For the sake of identification, both columns must be named by, respectively, id and Time. |
p |
The number of lag for Xt matrix. Current version restricts p <= 2 for simplicity, which aims at avoiding too many paramaters in low-frequency data of many variables and many countries. It will be relaxed soon. |
ecdet |
Character, 'none' for no intercept in cointegration, 'const' for constant term in cointegration and 'trend' for trend variable in cointegration. |
type |
Model specificaiton for VECM. As in package VECMs, we have four selection: "none","const","trend", "both". |
spec |
Determines the specification of the VECM, see details in pakcage urca. |
season |
If seasonal dummies should be included, the data frequency must be set accordingly,i.e '4' for quarterly data. |
weight.matrix |
Bilateral trade weight matrix for computing foreign VECMiables. If the computation of foreign VECMiables are weighted by one weighting matrix, weight.matrix must be a "data.frame". If the computation of foreign VECMiables are weighted on a year-to-year basis, then weight.matrix must be a "list, with the same length as the weighting frequency. |
JO.test |
List object of country-specific Johansen test results |
VECMoutputs |
List object of country-specific VECM results |
RESID |
List object of country-specific VECM residuals, obtained by using vars::vec2var |
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University.
Mauro Filippo di and Pesaran H. M. (2013) The GVECM Handbook– Structure and Applications of a Macro Model of the Global Economy for Policy. Oxford University Press.
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 type="const" ic="SC" weight.matrix=tradeweight1 mainOUT.JO=GVECM.jo(data=PriceVol,p=2,weight.matrix=weight.matrix) mainOUT.JO$JO.test
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 type="const" ic="SC" weight.matrix=tradeweight1 mainOUT.JO=GVECM.jo(data=PriceVol,p=2,weight.matrix=weight.matrix) mainOUT.JO$JO.test
Estimate country-specific Engle-Granger VECM in a Global VECM setting
GVECMest(data,p=2,lag.max=NULL, type="const", ic,weight.matrix=NULL)
GVECMest(data,p=2,lag.max=NULL, type="const", ic,weight.matrix=NULL)
data |
Dataframe is a strictly balanced panel data format,the first column is cross-section ID,and the second column is Time. For the sake of identification, both columns must be named by, respectively, id and Time. |
p |
The number of lag for Xt matrix. Foreign variables are set by FLag=p+1. Current version restricts p <= 2 for simplicity, which aims at avoiding too many paramaters in low-frequency data of many variables and many countries. It will be relaxed soon. |
lag.max |
The maximal number of lag for estimating country-specific VECM |
type |
Model specificaiton for VECM. As in package VECMs, we have four selection: "none","const","trend", "both". |
ic |
Information criteria for optimal lag.As in package VECMs, we have four selection: "AIC", "HQ", "SC", and "FPE". |
weight.matrix |
Bilateral trade weight matrix for computing foreign VECMiables. If the computation of foreign VECMiables are weighted by one weighting matrix, weight.matrix must be a "data.frame". If the computation of foreign VECMiables are weighted on a year-to-year basis, then weight.matrix must be a "list, with the same length as the weighting frequency. |
gvecm |
Country-specific GVECM output list |
White |
Coefficient estimates with White robust coVECMiance |
NWHAC |
Coefficient estimates withNewy-West robust coVECMiance |
p |
Number of lags for endogeneous VECMiables in VECM |
K |
Number of lags for Ft VECMiables in VECM |
type |
Model specificaiton. As in package VECMs, we have four selection: "none","const","trend", and "both". |
datamat |
input data=data |
lagmatrix |
GVECM's Country-secific optimal lag number. |
lagmatrix1 |
VECM's Country-secific optimal lag number. |
exoLag |
Ft lags |
Ft |
Foreign VECMiables |
NAMES |
Names of countries |
gvecmRSD |
Country-specific Global VECM residuals |
vecmRSD |
VECM residuals |
Ho Tsung-wu <[email protected]>, College of Management, National Taiwan Normal University.
Mauro Filippo di and Pesaran H. M. (2013) The GVECM Handbook– Structure and Applications of a Macro Model of the Global Economy for Policy. Oxford University Press.
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVECMest(data=PriceVol,p,lag.max,type,ic,weight.matrix) mainOUTPUT$lagmatrix # Country-specific GVECM lags mainOUTPUT$gvecm mainOUTPUT$gvecm[[1]] coef(mainOUTPUT$gvecm[[17]]) mainOUTPUT$White[[17]] mainOUTPUT$NWHAC[[17]][1]
data("PriceVol") data("tradeweight1") data("tradeweightx") p=2 FLag=2 lag.max=15 type="const" ic="SC" weight.matrix=tradeweightx mainOUTPUT = GVECMest(data=PriceVol,p,lag.max,type,ic,weight.matrix) mainOUTPUT$lagmatrix # Country-specific GVECM lags mainOUTPUT$gvecm mainOUTPUT$gvecm[[1]] coef(mainOUTPUT$gvecm[[17]]) mainOUTPUT$White[[17]] mainOUTPUT$NWHAC[[17]][1]
A nine-year balanced panel price-volumn data of 17 mareket indices, 2006/8/30-2014/11/19
data("PriceVol")
data("PriceVol")
A data frame with 0 observations on the following 2 variables.
ID
Names of country, cross-section ID
Time
Time index
Ret
Daily returns computed by close-to-close
Vol
Daily transaction volumn, by log
Yahoo finance
data(PriceVol)
data(PriceVol)
A single year cross-section bilateral trade weight matrix, 2014
data("tradeweight1")
data("tradeweight1")
A matrix of 17 by 17 bilateral trade weight matrix,2014
Australia
Bilateral trade weight matrix of Australia, 2014
Austria
Bilateral trade weight matrix of Austria, 2014
Belgium
Bilateral trade weight matrix of Belgium, 2014
Brazil
Bilateral trade weight matrix of Brazil, 2014
France
Bilateral trade weight matrix of France, 2014
UK
Bilateral trade weight matrix of UK, 2014
US
Bilateral trade weight matrix of US, 2014
Canada
Bilateral trade weight matrix of Canada, 2014
HongKong
Bilateral trade weight matrix of Hong Kong, 2014
Indonesia
Bilateral trade weight matrix of Indonesia, 2014
Malaysia
Bilateral trade weight matrix of Malaysia, 2014
Korea
Bilateral trade weight matrix of Korea, 2014
Mexico
Bilateral trade weight matrix of Mexico, 2014
Japan
Bilateral trade weight matrix of Japan, 2014
Swiss
Bilateral trade weight matrix of Swiss, 2014
China
Bilateral trade weight matrix of China, 2014
Taiwan
Bilateral trade weight matrix of Taiwan, 2014
This matrix is a 17 by 17 trade weight matrix, the column names are 17 countries. Given column j, the row-wise elements are bilateral trade weights of country j. Please make sure that the order of countries exactly matches the dataset's ID column.
data(tradeweight1) is.data.frame(tradeweight1)
data(tradeweight1) is.data.frame(tradeweight1)
A nine-year bilateral trade weight matrix, 2006-2014
data("tradeweightx")
data("tradeweightx")
A list with 17 by 17 matrix on the following variable.
Australia
Bilateral trade weight matrix of Australia, 2014
Austria
Bilateral trade weight matrix of Austria, 2014
Belgium
Bilateral trade weight matrix of Belgium, 2014
Brazil
Bilateral trade weight matrix of Brazil, 2014
France
Bilateral trade weight matrix of France, 2014
UK
Bilateral trade weight matrix of UK, 2014
US
Bilateral trade weight matrix of US, 2014
Canada
Bilateral trade weight matrix of Canada, 2014
HongKong
Bilateral trade weight matrix of Hong Kong, 2014
Indonesia
Bilateral trade weight matrix of Indonesia, 2014
Malaysia
Bilateral trade weight matrix of Malaysia, 2014
Korea
Bilateral trade weight matrix of Korea, 2014
Mexico
Bilateral trade weight matrix of Mexico, 2014
Japan
Bilateral trade weight matrix of Japan, 2014
Swiss
Bilateral trade weight matrix of Swiss, 2014
China
Bilateral trade weight matrix of China, 2014
Taiwan
Bilateral trade weight matrix of Taiwan, 2014
This example data is annual trade weight matrix, it is a list with length 9 (2006-2014).Each list is a year specific 17 by 17 trade weight matrix, the column names are 17 countries. Given column j, the row-wise elements are bilateral trade weights of country j. Make sure that the length of list must exactly match with the number of years. Because once you use this as tradewieght input matrix, R function will automatically compute foreign variables weighted year-by-year. Please make sure that the order of countries exactly matches the dataset's ID column.
data(tradeweightx) is.data.frame(tradeweightx)
data(tradeweightx) is.data.frame(tradeweightx)