summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-03-20 13:40:12 +0530
committerSuraj Yerramilli2016-03-20 13:40:12 +0530
commit23f84e46bd3818ba5f6bf355b83938329dfbb9db (patch)
tree5ab740420f4250aad752bd26001684921c8967ad
parent24c7e0e8730576f1ddb46af63acdf9cd913aa995 (diff)
downloadSysID-R-code-23f84e46bd3818ba5f6bf355b83938329dfbb9db.tar.gz
SysID-R-code-23f84e46bd3818ba5f6bf355b83938329dfbb9db.tar.bz2
SysID-R-code-23f84e46bd3818ba5f6bf355b83938329dfbb9db.zip
adding support for fixed parameters
-rw-r--r--R/estpoly.R5
1 files changed, 4 insertions, 1 deletions
diff --git a/R/estpoly.R b/R/estpoly.R
index 66cbb25..9f695db 100644
--- a/R/estpoly.R
+++ b/R/estpoly.R
@@ -162,7 +162,8 @@ residplot <- function(model,newdata=NULL){
#' plot(model) # plot the predicted and actual responses
#'
#' @export
-arx <- function(x,order=c(1,1,1),lambda=0.1,intNoise=FALSE){
+arx <- function(x,order=c(1,1,1),lambda=0.1,intNoise=FALSE,
+ fixed=list(A=rep(NA,order[1]),B=rep(NA,order[2]))){
y <- outputData(x); u <- inputData(x)
if(intNoise){
y <- apply(y,2,diff)
@@ -175,6 +176,8 @@ arx <- function(x,order=c(1,1,1),lambda=0.1,intNoise=FALSE){
yout <- apply(y,2,padZeros,n=n);
uout <- apply(u,2,padZeros,n=n);
+ fixedpos_A <- which(!is.na(fixed[[1]]))
+ fixedpos_B <- which(!is.na(fixed[[2]]))
reg <- function(i) {
if(nk==0) v <- i-0:(nb-1) else v <- i-nk:nb1
c(-yout[i-1:na,,drop=T],uout[v,,drop=T])