diff options
author | Suraj Yerramilli | 2015-06-07 18:21:56 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2015-06-07 18:21:56 +0530 |
commit | 20daf5b22edf32af8d6f8aff4dd9b6582adfc276 (patch) | |
tree | 9eed6248b3498224b59f6aa6916dc63bf73e9a09 | |
parent | b13406ccec1bea7dfbba4d4d5572eb69930e565a (diff) | |
download | SysID-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-- | NAMESPACE | 1 | ||||
-rw-r--r-- | R/estpoly.R | 5 |
2 files changed, 6 insertions, 0 deletions
@@ -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 |