Learn R Programming

sstvars (version 1.1.6)

get_Bt_Cpp: Calculate the impact matrix \(B_t\) for all \(t\) for models with a non-Gaussian conditional distribution with mutually independent shocks.

Description

This internal function takes a cube of matrices (all_Omegas) and a matrix of weights (alpha_mt), and calculates the weighted sums of the matrices in the cube. For each row in alpha_mt, it computes a weighted sum of matrices, and returns the

Usage

get_Bt_Cpp(all_Omegas, alpha_mt)

Value

An arma::cube value (3D array in R) such that each slice contains the weighted sum of the matrices, i.e, the impact matrix \(B_t\) for all \(t\).

Arguments

all_Omegas

A cube (3D array) of impact matrices, with each slice being an inveritble square matrix.

alpha_mt

A matrix of weights, with as many columns as there are slices in all_Omegas.