sur_const_to_tvp | R Documentation |
Transforms a dense matrix of dimensions KT \times M
into a sparse block
diagonal matrix of dimensions KT \times MT
.
sur_const_to_tvp(z, k, tt)
z |
a |
k |
integer of the number of endogenous variables. |
tt |
integer of the number of observations. |
A sparse block diagonal matrix of dimensions KT \times MT
.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.