[Vars-commits] r75 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Aug 23 21:22:27 CEST 2010


Author: matthieu
Date: 2010-08-23 21:22:27 +0200 (Mon, 23 Aug 2010)
New Revision: 75

Modified:
   pkg/R/internal.R
Log:
predict for restricetd models

Modified: pkg/R/internal.R
===================================================================
--- pkg/R/internal.R	2010-03-01 21:26:32 UTC (rev 74)
+++ pkg/R/internal.R	2010-08-23 19:22:27 UTC (rev 75)
@@ -5,7 +5,8 @@
 ##
 ".fecov" <-
 function(x, n.ahead) {
-  sigma.u <- crossprod(resid(x))/(x$obs - ncol(x$datamat[, -c(1:x$K)]))
+  n.par<-sapply(x$varresult, function(x) summary(x)$df[2])
+  sigma.u <- crossprod(resid(x))/n.par
   Sigma.yh <- array(NA, dim = c(x$K, x$K, n.ahead))
   Sigma.yh[, , 1] <- sigma.u
   Phi <- Phi(x, nstep = n.ahead)



More information about the Vars-commits mailing list