summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2015-06-07 18:21:56 +0530
committerSuraj Yerramilli2015-06-07 18:21:56 +0530
commit20daf5b22edf32af8d6f8aff4dd9b6582adfc276 (patch)
tree9eed6248b3498224b59f6aa6916dc63bf73e9a09
parentb13406ccec1bea7dfbba4d4d5572eb69930e565a (diff)
downloadSysID-R-code-20daf5b22edf32af8d6f8aff4dd9b6582adfc276.tar.gz
SysID-R-code-20daf5b22edf32af8d6f8aff4dd9b6582adfc276.tar.bz2
SysID-R-code-20daf5b22edf32af8d6f8aff4dd9b6582adfc276.zip
Added residual plots for poly models
-rw-r--r--NAMESPACE1
-rw-r--r--R/estpoly.R5
2 files changed, 6 insertions, 0 deletions
diff --git a/NAMESPACE b/NAMESPACE
index 390b324..ba90a0a 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -28,6 +28,7 @@ export(misdata)
export(read.idframe)
export(read.table.idframe)
export(read.xls.idframe)
+export(residplot)
export(sim)
export(spa)
export(step)
diff --git a/R/estpoly.R b/R/estpoly.R
index b327c77..7bf94ea 100644
--- a/R/estpoly.R
+++ b/R/estpoly.R
@@ -26,8 +26,13 @@ residplot <- function(model,newdata=NULL){
} else{
if(class(newdata)!="idframe") stop("Only idframe objects allowed")
e <- newdata$output - predict(model,newdata)
+ u <- newdata$input
}
+ acorr <- acf(e,plot = F); ccorr <- ccf(as.numeric(u),e,plot = F)
+ par(mfrow=c(2,1),mar=c(3,4,4,2))
+ plot(acorr,main="ACF of residuals")
+ plot(ccorr,main="CCF between the input and residuals",ylab="CCF")
}
#' Estimate ARX Models