From 361456717ba2c2e1fb75c48669428580a8b0c8c6 Mon Sep 17 00:00:00 2001 From: Suraj Yerramilli Date: Fri, 30 Oct 2015 21:20:59 +0530 Subject: Writing ARMAX code --- R/estpoly.R | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'R') diff --git a/R/estpoly.R b/R/estpoly.R index cfb4390..92647cd 100644 --- a/R/estpoly.R +++ b/R/estpoly.R @@ -175,4 +175,16 @@ arx <- function(x,order=c(0,1,0)){ estPoly(coefficients = model,vcov = vcov, sigma = sqrt(sigma2), df = df,fitted.values=(X%*%coef)[1:N,], residuals=(Y-X%*%coef)[1:N,],call=match.call(),input=u) +} + +armax <- function(x,order=c(0,1,1,0)){ + y <- outputData(x); u <- inputData(x); N <- dim(y)[1] + e <- matrix(rep(0,N),ncol=1) + na <- order[1];nb <- order[2]-1; nc <- order[3] + nb1 <- nb+nk ; n <- max(na,nb1,nc) + + if(nc<1) + stop("Error: Not an ARMAX model") + + } \ No newline at end of file -- cgit