diff options
-rw-r--r-- | R/impulse.R | 24 | ||||
-rw-r--r-- | R/tf.R | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/R/impulse.R b/R/impulse.R new file mode 100644 index 0000000..834a42d --- /dev/null +++ b/R/impulse.R @@ -0,0 +1,24 @@ +# Estimate Impulse Response Models +impulseest <- function(data,lags=30,conf=0.95){ + require(vars) + Z <- cbind(data$output,data$input) + + fit.var <- VAR(Z,p=10) + ir <- irf(fit.var,impulse=colnames(data$input),response=colnames(data$output), + n.ahead = lags,ci=conf) + + out <- list() + class(out) <- "impulseest" + return(out) +} + +# Impulse Response Plots +impulse <- function(model){ + +} + + +# Step Response Plots +step <- function(model){ + +} @@ -19,6 +19,7 @@ tf <- function(num=c(1),den=c(1),Ts=1){ #' Printing method for objects inheriting from class \code{tf} #' #' @param G an object of class \code{tf} +#' @export print.tf <- function(G){ cat("Transfer Function \nG(q^{-1}) = B(q^{-1})/A(q^{-1}) \n\n") cat("A(q^{-1}) = ") |