bvar_jeff: Draws posterior of VAR(p) Model with non-informative prior

Description Usage Arguments Details Value Examples

View source: R/bvar_jeff.R

Description

create_inventory constructs companion matrix for VAR(p) model.

Usage

1
bvar_jeff(Yts, p, const)

Arguments

Yts

n x T matrix of data.

p

the lag lenght of the VAR.

const

A scalar, where const = 1 for model with intercept, const = 0 for model without intercept.

Details

This function draws from the posterior of a VAR(p) model with non-informative prior

Value

A List with:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
yt <- as.matrix(t(Xmat))
k <- 2
n <- dim(yt)[1]
q <- 1
m <- k*q
Q <- as.matrix(diag(0.1,k))
R <- as.matrix(diag(n)*0.01)
alpha_0 <- matrix(0,m,1)
P_0 <- diag(m)
lambdasim <- matrix(rep(rnorm(n,0,1)*0.1,k),
nrow = n, ncol = k, byrow = TRUE)
diag(lambdasim) <- 1
lambdasim[upper.tri(lambdasim)] <- 0
lambda <- lambdasim
Tt <- dim(yt)[2]
phi <- diag(rnorm(k,0,1))
const <- 0
ft <-  multimove_gibbs(yt,phi,Q,lambda,const,Tt,q,alpha_0,P_0,R)
param <- bvar_jeff(ft,q,0)

h4sci/packagr documentation built on Jan. 7, 2021, 10:40 p.m.