sample_Wt: Evolution error variance sampler

Description Usage Arguments Value Note Examples

View source: R/component_samplers.R

Description

Sample the (non-dynamic) evolution error variance matrix.

Usage

1
sample_Wt(resBeta, Rinv = diag(1, K), rh0 = K, useDiagonal = FALSE)

Arguments

resBeta

(T-1) x K matrix of residuals from the evolution equation

Rinv

K x K; only needed for useDiagonal = FALSE

rh0

scalar prior scale parameter; only needed for useDiagonal = FALSE

useDiagonal

logical; when TRUE, use a diagonal covariance matrix; otherwise, use a full matrix

Value

The K x K evolution error covariance matrix, Wt.

Note

The sampler has two options: useDiagonal = TRUE, in which the evolution error variance matrix is diagional with independent Gamma(0.001,0.001) priors on the K diagonal component precisions; and useDiagonal = FALSE, in which the K x K evolution error variance matrix is full with an inverse Wishart prior with prior precision Rinv and scale parameter rh0. The default is Rinv = diag(1, K) and rh0 = K.

Examples

1
2
3
4
5
6
# Simulate an example:
n = 100; K = 3
resBeta = matrix(rnorm(n*K), nr = n, nc = K)

# Sample the variance:
sample_Wt(resBeta)

drkowal/FDLM documentation built on May 20, 2019, 5:20 p.m.