R/Phi.svarest.R

"Phi.svarest" <-
function(x, nstep = 10, ...){
  if(!is(x, "svarest")){
    stop("\nPlease provide an object of class 'svarest', generated by 'SVAR()'.\n")
  }
  nstep <- abs(as.integer(nstep))
  Ainv <- solve(x$A)
  Phi <- Phi(x$var, nstep = nstep)
  for(i in 1: dim(Phi)[3]){
    Phi[, , i] <- Phi[, , i] %*% Ainv %*% x$B
  }
  return(Phi)
}

Try the vars package in your browser

Any scripts or data that you put into this service are public.

vars documentation built on March 31, 2023, 10:30 p.m.