[Vars-commits] r91 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed May 22 23:41:12 CEST 2013


Author: bpfaff
Date: 2013-05-22 23:41:12 +0200 (Wed, 22 May 2013)
New Revision: 91

Modified:
   pkg/R/logLik.vec2var.R
Log:
Added 'df' and 'nobs' attribute to returned object.


Modified: pkg/R/logLik.vec2var.R
===================================================================
--- pkg/R/logLik.vec2var.R	2013-05-21 20:24:07 UTC (rev 90)
+++ pkg/R/logLik.vec2var.R	2013-05-22 21:41:12 UTC (rev 91)
@@ -6,5 +6,8 @@
     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 <- length(unlist(object$A)) + length(object$deterministic)
+    attr(r, "df") <- params
+    attr(r, "nobs") <- object$obs
     return(r)
 }



More information about the Vars-commits mailing list