getweights {BGVAR}R Documentation

getweights

Description

This function sets up the K times K weight matrix.

Usage

getweights(W,Data, EA.weights=NULL, OC.weights=NULL, wex.restr=NULL,variable.list=NULL)

Arguments

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 (y and prices p). ea.weights is a list whith the first slot containing a vector of weights to aggregate single euro area countrys' output and price figures. In the example using the monthlyData set, we use purchasing power parity weights. The second slot contains a character vector that specifies the variables which should enter the Taylor rule (typicall output and prices). Set ea.weights=NULL to proceed without the ECB country model.

OC.weights

This feature is very similar to EA.weights above and should be specified if an own country model for the oil price should be included – as opposed to having oil prices attached to a particular country model, as is standard in the literature. It is important that the country model is labeled 'OC'. Again, OC.weights is a list of length 2, the first slot should be a vector of weights to aggregate variables, second one the variables to aggregate. The vector of weights should have country names attached to it. In the example using the monthlyData2 set, we use purchasing power parity weights to aggregate world output to resemble demand for oil. Set OC.weights=NULL to proceed without the oil country model.

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 wex.restr=NULL.

variable.list

A list that contains the variables that should be weighted if more than one weight matrix was submitted.

Value

gW

A list object of length N containing the weights for each country that are used to construct the weakly exogeneous variables.

bigx

A matrix of dimension T times K containing the data.

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 exo.

endo

The list of variables that are endogeneously determined within the country models.

Author(s)

Martin Feldkircher and Florian Huber

Examples

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)


[Package BGVAR version 1.1.3 Index]