summaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorSuraj Yerramilli2015-03-22 23:55:38 +0530
committerSuraj Yerramilli2015-03-22 23:55:38 +0530
commitf995715a8525d9e01528a60ed1a718b3aeff3111 (patch)
tree1229b99968bc6455abdd3716b28775e90b0a3b4e /R
parenta74ce396b0dac33aee99737428f4efb041217ee0 (diff)
downloadSysID-R-code-f995715a8525d9e01528a60ed1a718b3aeff3111.tar.gz
SysID-R-code-f995715a8525d9e01528a60ed1a718b3aeff3111.tar.bz2
SysID-R-code-f995715a8525d9e01528a60ed1a718b3aeff3111.zip
Added skeleton for impulse response models
Diffstat (limited to 'R')
-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}) = ")