diff options
author | Suraj Yerramilli | 2016-03-18 10:51:53 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2016-03-18 10:51:53 +0530 |
commit | 7c9e87890244ec54f3ce8f4fe53dd08d8bbe8d4f (patch) | |
tree | 3e24fd1f3cfdaa19dc50f41e8fc07b5761778265 | |
parent | 5bd4a21f60a7441f223ebd4c8386ac54da7c63aa (diff) | |
download | SysID-R-code-7c9e87890244ec54f3ce8f4fe53dd08d8bbe8d4f.tar.gz SysID-R-code-7c9e87890244ec54f3ce8f4fe53dd08d8bbe8d4f.tar.bz2 SysID-R-code-7c9e87890244ec54f3ce8f4fe53dd08d8bbe8d4f.zip |
adding provision for integrated noise channel
-rw-r--r-- | R/poly.R | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -33,13 +33,13 @@ #' #' @export idpoly <- function(A=1,B=1,C=1,D=1,F1=1,ioDelay=0,Ts=1, - noiseVar=1,unit = c("seconds","minutes", + noiseVar=1,intNoise = F,unit = c("seconds","minutes", "hours","days")[1]){ Bindex <- which.max(B!=0) ioDelay <- ifelse(Bindex-1==0,ioDelay,Bindex-1) B <- B[Bindex:length(B)] out <- list(A= A,B=B,C=C,D=D,F1=F1,ioDelay = ioDelay,Ts=Ts, - noiseVar=noiseVar,unit=unit) + noiseVar=noiseVar,unit=unit,intNoise = intNoise) out$type <- typecheck(out) class(out) <- "idpoly" return(out) @@ -51,7 +51,12 @@ typecheck <- function(x){ out <- if(y$C && y$D) if(y$F1) "fir" else "oe" else "bj" } else{ if(y$D && y$F1){ - out <- if(y$C) "arx" else "armax" + if(x$intNoise){ + out <- if(y$C) "ari" else "arima" + } else{ + out <- if(y$C) "ar" else "arma" + } + if(y$B) out <- paste(out,"x",sep="") } else{ out <- "polynomial" } |