diff options
author | Suraj Yerramilli | 2015-12-29 16:01:52 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2015-12-29 16:01:52 +0530 |
commit | ad42d5379ea3a6cd81def21e6f1648d0bad4e2c2 (patch) | |
tree | 7025382f181cb134afed9b080f0a1b68e498a651 /R | |
parent | f4b608cf7ce44a9c7c72527baa153b397b9729cc (diff) | |
download | SysID-R-code-ad42d5379ea3a6cd81def21e6f1648d0bad4e2c2.tar.gz SysID-R-code-ad42d5379ea3a6cd81def21e6f1648d0bad4e2c2.tar.bz2 SysID-R-code-ad42d5379ea3a6cd81def21e6f1648d0bad4e2c2.zip |
updated armax to the new structure
Diffstat (limited to 'R')
-rw-r--r-- | R/estUtil.R | 2 | ||||
-rw-r--r-- | R/estpoly.R | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/R/estUtil.R b/R/estUtil.R index d17ccbf..eede460 100644 --- a/R/estUtil.R +++ b/R/estUtil.R @@ -28,7 +28,7 @@ armaxGrad <- function(theta,e,dots){ } # Implementation of the Levenberg Marquardt Algorithm -levbmqdt <- function(...,obj,theta0,N,opt=optimOptions()){ +levbmqdt <- function(...,obj,theta0,N,opt){ dots <- list(...) # Optimization Parameters diff --git a/R/estpoly.R b/R/estpoly.R index 111e539..3135aec 100644 --- a/R/estpoly.R +++ b/R/estpoly.R @@ -270,15 +270,17 @@ armax <- function(x,order=c(0,1,1,0),options=optimOptions()){ } theta0 <- matrix(rnorm(na+nb+nc)) # current parameters - l <- levbmqdt(yout,uout,order,N,obj=armaxGrad,theta0=theta0,N=N) - theta <- l$theta + l <- levbmqdt(yout,uout,order,N,obj=armaxGrad,theta0=theta0,N=N, + opt=options) + theta <- l$params + e <- ts(l$residuals,start = start(y),deltat = deltat(y)) model <- idpoly(A = c(1,theta[1:na]),B = theta[na+1:nb], C = c(1,theta[na+nb+1:nc]),ioDelay = nk,Ts=deltat(x)) - estpoly(coefficients = model,vcov = l$vcov, sigma = l$sigma,df = df, - fitted.values=y, residuals=l$e,call=match.call(), - input=u) + estpoly(sys = model,stats=list(vcov = vcov, sigma = sqrt(sigma2)), + fitted.values=y-e,residuals=e,call=match.call(),input=u, + options = options,termination = l$termination) } #' Estimate Output-Error Models |