specify_starting_values_bsvar_t function

R6 Class Representing StartingValuesBSVART

R6 Class Representing StartingValuesBSVART

The class StartingValuesBSVART presents starting values for the bsvar model with t-distributed structural shocks.

Examples

# starting values for a bsvar model for a 3-variable system sv = specify_starting_values_bsvar_t$new(N = 3, p = 1, T = 100) ## ------------------------------------------------ ## Method `specify_starting_values_bsvar_t$get_starting_values` ## ------------------------------------------------ # starting values for a homoskedastic bsvar with 1 lag for a 3-variable system sv = specify_starting_values_bsvar$new(N = 3, p = 1) sv$get_starting_values() # show starting values as list ## ------------------------------------------------ ## Method `specify_starting_values_bsvar_t$set_starting_values` ## ------------------------------------------------ # starting values for a homoskedastic bsvar with 1 lag for a 3-variable system sv = specify_starting_values_bsvar$new(N = 3, p = 1) # Modify the starting values by: sv_list = sv$get_starting_values() # getting them as list sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry sv$set_starting_values(sv_list) # providing to the class object

Super class

bsvars::StartingValuesBSVAR -> StartingValuesBSVART

Public fields

  • A: an NxK matrix of starting values for the parameter AA.

  • B: an NxN matrix of starting values for the parameter BB.

  • hyper: a (2*N+1)x2 matrix of starting values for the shrinkage hyper-parameters of the hierarchical prior distribution.

  • lambda: a Tx1 vector of starting values for latent variables.

  • df: a positive scalar with starting values for the degrees of freedom parameter of the Student-t conditional distribution of structural shock.

Methods

Public methods

Method new()

Create new starting values StartingValuesBSVART

Usage

specify_starting_values_bsvar_t$new(N, p, T, d = 0)

Arguments

  • N: a positive integer - the number of dependent variables in the model.

  • p: a positive integer - the autoregressive lag order of the SVAR model.

  • T: a positive integer - the the time series dimension of the dependent variable matrix YY.

  • d: a positive integer - the number of exogenous variables in the model.

Returns

Starting values StartingValuesBSVART

Method get_starting_values()

Returns the elements of the starting values StartingValuesBSVAR as a list.

Usage

specify_starting_values_bsvar_t$get_starting_values()

Examples

# starting values for a homoskedastic bsvar with 1 lag for a 3-variable system
sv = specify_starting_values_bsvar$new(N = 3, p = 1)
sv$get_starting_values()   # show starting values as list

Method set_starting_values()

Returns the elements of the starting values StartingValuesBSVAR as a list.

Usage

specify_starting_values_bsvar_t$set_starting_values(last_draw)

Arguments

  • last_draw: a list containing the last draw of elements B - an NxN matrix, A - an NxK matrix, and hyper - a vector of 5 positive real numbers.

Returns

An object of class StartingValuesBSVAR including the last draw of the current MCMC as the starting value to be passed to the continuation of the MCMC estimation using estimate().

Examples

# starting values for a homoskedastic bsvar with 1 lag for a 3-variable system
sv = specify_starting_values_bsvar$new(N = 3, p = 1)

# Modify the starting values by:
sv_list = sv$get_starting_values()   # getting them as list
sv_list$A <- matrix(rnorm(12), 3, 4) # modifying the entry
sv$set_starting_values(sv_list)      # providing to the class object

Method clone()

The objects of this class are cloneable with this method.

Usage

specify_starting_values_bsvar_t$clone(deep = FALSE)

Arguments

  • deep: Whether to make a deep clone.

  • Maintainer: Tomasz Woźniak
  • License: GPL (>= 3)
  • Last published: 2024-10-24