diff --git a/NAMESPACE b/NAMESPACE index 8fbfd12..ecaa80e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -28,6 +28,7 @@ S3method(plot,fevdirf) S3method(plot,fevfd) S3method(plot,irffd) export(bootstrap) +export(fev) export(fevdfd) export(fevfd) export(hd) diff --git a/R/fev.R b/R/fev.R index dc1a35c..a59ee9e 100644 --- a/R/fev.R +++ b/R/fev.R @@ -5,6 +5,14 @@ #' #' @return forecast error variance #' +#' @export +#' +#' @examples +#' x <- svars::USA +#' v <- vars::VAR(x, p = 2) +#' mvar <- id_fevdtd(v, "pi", 4:10) +#' fev(mvar) +#' fev <- function(var, n_ahead = 20) { n <- colnames(var$y) k <- length(n) diff --git a/man/fev.Rd b/man/fev.Rd index 2559083..29bbcee 100644 --- a/man/fev.Rd +++ b/man/fev.Rd @@ -17,3 +17,10 @@ forecast error variance \description{ Calculate the forecast error variance for a VAR out to a specified horizon } +\examples{ +x <- svars::USA +v <- vars::VAR(x, p = 2) +mvar <- id_fevdtd(v, "pi", 4:10) +fev(mvar) + +}