diff options
Diffstat (limited to 'R')
-rw-r--r-- | R/nonparam.R | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/R/nonparam.R b/R/nonparam.R index af12786..67f785a 100644 --- a/R/nonparam.R +++ b/R/nonparam.R @@ -48,8 +48,8 @@ impulseest <- function(data,M=30,K=0,regul=F,lambda=1){ } else{ inner <- t(Z)%*%Z + lambda*diag(dim(Z)[2]) pinv <- solve(inner)%*% t(Z) - coefficients <- pinv*Y - residuals <- Y - Z*coefficients + coefficients <- pinv%*%Y + residuals <- Y - Z%*%coefficients } df <- nrow(Z)-ncol(Z);sigma2 <- sum(residuals^2)/df vcov <- sigma2 * solve(t(Z)%*%Z) |