getweights {BGVAR} | R Documentation |
This function sets up the K times K weight matrix.
getweights(W,Data, EA.weights=NULL, OC.weights=NULL, wex.restr=NULL,variable.list=NULL)
W |
Can be either an N times N weight matrix or a list of weight matrices if different weights should be used based on the type of variables (e.g., financial versus real variables). Each weight matrix should be normalized, i.e., 0 elements on the diagonal and row sums that sum up to unity. |
Data |
A list of length N that contains the data. Each element of the list refers to a country. The number of columns (i.e., variables) in each country model can be different. The rows (i.e., number of time observations), however, need to be the same for each country. |
EA.weights |
To model the common monetary policy in the euro area, it is possible to augment the GVAR countries by a country model for the ECB. It is important that this country model is labeled 'EB'. Akin to Georgidas (2015) we use a Taylor rule to determine interest rates in the euro area. The Taylor rule typically relates short-term interest rates to a weighted average of output ( |
OC.weights |
This feature is very similar to |
wex.restr |
A character vector that contains variables that should only be specified as weakly exogeneous if not contained as endogeneous variable in a particular country. An example that has often been used in the literature is to place these restrictions on nominal exchange rates. These are by construction not contained in the anchor currency country and one might still want to control for exchange rate movements by including a weakly exogeneoues exchange rate. The default setting is |
variable.list |
A list that contains the variables that should be weighted if more than one weight matrix was submitted. |
gW |
A list object of length |
bigx |
A matrix of dimension |
exo |
A vector that contains the names of the variables that are determined within only one country model (e.g., oil prices). |
exo.countries |
The countries that include endogeneously the exogenoues variables listed in |
endo |
The list of variables that are endogeneously determined within the country models. |
Martin Feldkircher and Florian Huber
library(BGVAR) # Example with monthly data and ECB country model akin to Georgiadis (2015) data(monthlyData2) # re-move oil price country model new.data2$OC<-NULL # select short-term interest rates as endo. variable in EB model new.data2$EB<-new.data2$EB[,"EAstir",drop=FALSE] # make sure that EB is still a matrix via drop=FALSE EA.weights$exo<-"EAstir" # we want EA short-term rates to be exog. introduced into other country models EA.weights$variables<-c("y","p") # variables to be aggregated into Taylor rule model.sims<-bgvar(Data=new.data2,W=W,saves=100,burns=100,plag=1,hyperparm=NULL,Cpu=1,prior="SIMS",save_thin=1,eigen=TRUE,logfile=FALSE,stats=TRUE,ea.weights=EA.weights) # Example with monthly data, ECB model (EB) and oil model (OC) data(monthlyData2) gW=getweights(Data=new.data2,W=W,EA.weights=EA.weights, OC.weights=OC.weights) model.sims<-bgvar(Data=new.data2,W=W,saves=100,burns=100,plag=1,hyperparm=NULL,Cpu=1,prior="SIMS",save_thin=1,eigen=TRUE,logfile=FALSE,stats=TRUE,ea.weights=EA.weights,OC.weights=OC.weights) print.bgvar(model.sims) # does include ltir* only when ltir is missing domestically gW=getweights(Data=new.data2,W=W,EA.weights=EA.weights,wex.restr="ltir",OC.weights=OC.weights) # Distinct weights for different variable categories data(eerData) variable.list<-list();variable.list$real<-c("y","Dp","tb");variable.list$fin<-c("stir","ltir","rer") # weights for first variable set tradeW.0012, for second finW0711 gW<-getweights(Data=eer.data,W=W.list[c("tradeW.0012","finW0711")],variable.list=variable.list)