summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2015-06-05 17:28:39 +0530
committerSuraj Yerramilli2015-06-05 17:28:39 +0530
commitf238926cee9e8dd9ac86c2db451844fcb65e9395 (patch)
treeedc486650e34634f0d6a25c331281bb5dec32b19
parentbcb4780f702ed6fe1b24c9f9027f7038db23b950 (diff)
downloadSysID-R-code-f238926cee9e8dd9ac86c2db451844fcb65e9395.tar.gz
SysID-R-code-f238926cee9e8dd9ac86c2db451844fcb65e9395.tar.bz2
SysID-R-code-f238926cee9e8dd9ac86c2db451844fcb65e9395.zip
Added summary function for estARX
-rw-r--r--R/estpoly.R18
1 files changed, 17 insertions, 1 deletions
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