diff options
-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 |