diff options
-rw-r--r-- | R/estpoly.R | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/R/estpoly.R b/R/estpoly.R index ddfaf93..e39c796 100644 --- a/R/estpoly.R +++ b/R/estpoly.R @@ -261,11 +261,11 @@ armax <- function(x,order=c(0,1,1,0),options=optimOptions()){ uout <- apply(u,2,padZeros,n=n) # Initial Parameter Estimates - mod_arx <- iv4(x,c(na,nb,nk)) # fitting ARX model + mod_arx <- iv(x,c(na,nb,nk)) # fitting ARX model eps_init <- matrix(resid(mod_arx)) - mod_ma <- arima(eps_init,order=c(0,0,1),include.mean = F) - e_init <- matrix(mod_ar$residuals); e_init[is.na(e_init)] <- 0 - theta0 <- matrix(c(mod_arx$sys$A[-1],mod_arx$sys$B,mod_ar$coef)) + mod_ma <- arima(eps_init,order=c(0,0,nc),include.mean = F) + e_init <- matrix(mod_ma$residuals); e_init[is.na(e_init)] <- 0 + theta0 <- matrix(c(mod_arx$sys$A[-1],mod_arx$sys$B,mod_ma$coef)) l <- levbmqdt(yout,uout,order,e_init,obj=armaxGrad, theta0=theta0,N=N,opt=options) |