sur_const_to_tvp: SUR Matrix Transformation

View source: R/RcppExports.R

sur_const_to_tvpR Documentation

SUR Matrix Transformation

Description

Transforms a dense matrix of dimensions KT \times M into a sparse block diagonal matrix of dimensions KT \times MT.

Usage

sur_const_to_tvp(z, k, tt)

Arguments

z

a KT \times M matrix.

k

integer of the number of endogenous variables.

tt

integer of the number of observations.

Value

A sparse block diagonal matrix of dimensions KT \times MT.

Examples


# Specify the dimensions of the dense matrix
k <- 2
tt <- 5
m <- 3

# Generate artificial data
z <- matrix(NA, k * tt, m)
for (i in 1:tt) {
  z[(i - 1) * k + 1:k, ] <- i
}

# Perform transformation
sur_const_to_tvp(z, k, tt)



franzmohr/bvartools documentation built on Jan. 28, 2024, 4:06 a.m.