From 83363938ea815ce70764b180d21826cd70b2781b Mon Sep 17 00:00:00 2001 From: Suraj Yerramilli Date: Sat, 13 Feb 2016 14:22:37 +0530 Subject: added argument for regularization parameter --- R/estpoly.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'R') diff --git a/R/estpoly.R b/R/estpoly.R index 06e6102..686c147 100644 --- a/R/estpoly.R +++ b/R/estpoly.R @@ -160,7 +160,7 @@ residplot <- function(model,newdata=NULL){ #' plot(model) # plot the predicted and actual responses #' #' @export -arx <- function(x,order=c(0,1,0)){ +arx <- function(x,order=c(0,1,0),lambda=0.1){ y <- outputData(x); u <- inputData(x); N <- dim(y)[1] na <- order[1];nb <- order[2]; nk <- order[3] nb1 <- nb+nk-1 ; n <- max(na,nb1); df <- N-na-nb @@ -176,7 +176,7 @@ arx <- function(x,order=c(0,1,0)){ X <- t(sapply(n+1:(N+n),reg)) Y <- yout[n+1:(N+n),,drop=F] - lambda <- 0.1 + # lambda <- 0.1 inner <- t(X)%*%X + lambda*diag(dim(X)[2]) innerinv <- solve(inner) pinv <- innerinv%*% t(X) -- cgit