From f238926cee9e8dd9ac86c2db451844fcb65e9395 Mon Sep 17 00:00:00 2001 From: Suraj Yerramilli Date: Fri, 5 Jun 2015 17:28:39 +0530 Subject: Added summary function for estARX --- R/estpoly.R | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/R/estpoly.R b/R/estpoly.R index a895525..0aeb8b5 100644 --- a/R/estpoly.R +++ b/R/estpoly.R @@ -19,7 +19,6 @@ estARX <- function(data,order=c(0,1,0)){ sigma2 <- sum((Y-X%*%coef)^2)/df vcov <- sigma2 * chol2inv(qx$qr) - colnames(vcov) <- rownames(vcov) <- colnames(X) model <- arx(A = c(1,coef[1:na]),B = coef[na+1:nb1],ioDelay = nk) @@ -28,4 +27,21 @@ estARX <- function(data,order=c(0,1,0)){ residuals=(Y-X%*%coef)[1:N,],call=match.call()) class(est) <- "estARX" est +} + +#' @export +summary.estARX <- function(object) +{ + coefs <- c(coef(object)$A[-1],coef(object$B)) + se <- sqrt(diag(object$vcov)) + tval <- coefs / se + TAB <- cbind(Estimate = coef(object), + StdErr = se, + t.value = tval, + p.value = 2*pt(-abs(tval), df=object$df)) + TAB <- + + res <- list(call=object$call,coefficients=TAB) + class(res) <- "summary.estARX" + res } \ No newline at end of file -- cgit