diff options
author | Suraj Yerramilli | 2015-06-06 00:24:38 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2015-06-06 00:24:38 +0530 |
commit | cb696cfcc830e10b6518cf1d768884e967bc84b3 (patch) | |
tree | 6a56f6cb166b2b4431a2491fe435d2d580c11d07 | |
parent | a54aef7be7f1db6aca3588719832751dd4ce00d7 (diff) | |
download | SysID-R-code-cb696cfcc830e10b6518cf1d768884e967bc84b3.tar.gz SysID-R-code-cb696cfcc830e10b6518cf1d768884e967bc84b3.tar.bz2 SysID-R-code-cb696cfcc830e10b6518cf1d768884e967bc84b3.zip |
Added variance info
-rw-r--r-- | R/sim.R | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2,7 +2,7 @@ sim <- function(x) useMethod("sim") #' @export -sim.arx <- function(model,input){ +sim.arx <- function(model,input,sigma=0){ na <- length(model$A) - 1; nk <- model$ioDelay; nb <- length(model$B) - nk n <- max(na,nb+nk) @@ -14,7 +14,7 @@ sim.arx <- function(model,input){ for(i in n+1:length(input)){ reg <- cbind(-y[i-1:na,],u[i-nk:nb1,]) - y[i] <- reg%*%coef + y[i] <- reg%*%coef + rnorm(1,sd = sigma) } return(y[n+1:length(input),,drop=F]) }
\ No newline at end of file |