[Vars-commits] r89 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 21 22:21:53 CEST 2013


Author: bpfaff
Date: 2013-05-21 22:21:53 +0200 (Tue, 21 May 2013)
New Revision: 89

Modified:
   pkg/R/logLik.varest.R
Log:
Included attributes for logLik(), objects of class varest


Modified: pkg/R/logLik.varest.R
===================================================================
--- pkg/R/logLik.varest.R	2012-07-28 12:51:43 UTC (rev 88)
+++ pkg/R/logLik.varest.R	2013-05-21 20:21:53 UTC (rev 89)
@@ -6,5 +6,8 @@
   Sigma <- crossprod(resids) / obs
   r <- -( obs * K / 2 ) * log(2 * pi) - (obs / 2) * log(det(Sigma)) - (1 / 2) * sum(diag(resids %*% solve(Sigma) %*% t(resids)))
   class(r) <- "logLik"
+  params <- sum(unlist(lapply(object$varresult, function(x) length(coef(x)))))
+  attr(r, "df") <- params
+  attr(r, "nobs") <- object$obs
   return(r)
 }



More information about the Vars-commits mailing list