diff options
author | Suraj Yerramilli | 2016-01-04 19:36:56 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2016-01-04 19:36:56 +0530 |
commit | 26b6f9b837dac73f927a5ceed9442544191c2258 (patch) | |
tree | 3fbcb8f411f3b027a966719b55e48e3c3ee3df9b /R/predict.R | |
parent | d831fea9c22bb609a2c4d4131b666eb4a654bb51 (diff) | |
download | SysID-R-code-26b6f9b837dac73f927a5ceed9442544191c2258.tar.gz SysID-R-code-26b6f9b837dac73f927a5ceed9442544191c2258.tar.bz2 SysID-R-code-26b6f9b837dac73f927a5ceed9442544191c2258.zip |
added the compare routine
Diffstat (limited to 'R/predict.R')
-rw-r--r-- | R/predict.R | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/R/predict.R b/R/predict.R index a3a8083..d11578e 100644 --- a/R/predict.R +++ b/R/predict.R @@ -54,8 +54,16 @@ predict.estpoly <- function(x,newdata=NULL,nahead=1){ } } -#' @import ggplot2 reshape +#' @import ggplot2 reshape2 #' @export -compare <- function(){ +compare <- function(data,nahead=1,...){ + # Input Validation + dots <- list(...) + if(is.null(dots)) stop("No model supplied") + Y <- sapply(dots,predict,newdata=data,nahead=nahead) + df <- data.frame(Time = time(data),Actual=outputData(data)[,1],Y) + meltdf <- melt(df,id="Time") + + ggplot(meltdf,aes(x=Time,y=value,color=variable,group=variable))+geom_line() }
\ No newline at end of file |