summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--R/impulse.R24
-rw-r--r--R/tf.R1
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){
+
+}
diff --git a/R/tf.R b/R/tf.R
index 2338778..350f4bd 100644
--- a/R/tf.R
+++ b/R/tf.R
@@ -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}) = ")