irf_x | R Documentation |
irf_x
is a helper function rotating arrays in the third
dimension of the given array.
irf_x(irf, pre_mat = NULL, post_mat = NULL)
irf |
|
pre_mat |
matrix used in the left multiplication of the IRF |
post_mat |
matrix used in the right multiplication of the IRF |
An array rotated in the third dimension.
# create a random array corresponding to the impulse response function
irf_ex <- stats::rnorm(4*4*4) %>% array(dim = c(4,4,4))
# assume the recursive identification via cholesky is given as
chol_ex <- stats::rnorm(16) %>% matrix(4,4) %>% tcrossprod() %>% chol() %>% t()
# then the recursive identification of the IRF can be obtained as
(sirf_ex <- irf_x(irf_ex, post_mat = solve(irf_ex[,,1])%*%chol_ex) %>% zapsmall())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.