diff options
author | Suraj Yerramilli | 2015-06-07 18:05:17 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2015-06-07 18:05:17 +0530 |
commit | b13406ccec1bea7dfbba4d4d5572eb69930e565a (patch) | |
tree | 2dead597a3226a6319dbbb686c6a43122b3510f3 /R | |
parent | d6036ccc9963acf0903457e48150f608eb77dd8c (diff) | |
download | SysID-R-code-b13406ccec1bea7dfbba4d4d5572eb69930e565a.tar.gz SysID-R-code-b13406ccec1bea7dfbba4d4d5572eb69930e565a.tar.bz2 SysID-R-code-b13406ccec1bea7dfbba4d4d5572eb69930e565a.zip |
Minor changes
Diffstat (limited to 'R')
-rw-r--r-- | R/estpoly.R | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/R/estpoly.R b/R/estpoly.R index 64cdb3e..b327c77 100644 --- a/R/estpoly.R +++ b/R/estpoly.R @@ -19,6 +19,17 @@ plot.estPoly <- function(model,newdata=NULL){ geom_line() + theme_bw() } +#' @export +residplot <- function(model,newdata=NULL){ + if(is.null(newdata)){ + e <- resid(model); u <- model$input + } else{ + if(class(newdata)!="idframe") stop("Only idframe objects allowed") + e <- newdata$output - predict(model,newdata) + } + +} + #' Estimate ARX Models #' #' Fit an ARX model of the specified order given the input-output data @@ -108,7 +119,7 @@ predict.estARX <- function(model,newdata=NULL){ if(is.null(newdata)){ return(fitted(model)) } else{ - return(sim(coef(model),newdata)) + return(sim(coef(model),as.numeric(newdata$input))) } } |