[R] possible bug in vars package (predict.varest) ???

Leeds, Mark (IED) Mark.Leeds at morganstanley.com
Thu Aug 30 23:50:02 CEST 2007

yes, you can just pulldown the tar.gz file and tar -xvf it and that
will give you many directories one of which will
contain the source. I've done that with the vars package in the past (
bernhard's code is very nice to read ) and I would just send 
you the code to predict.varest but I don't think predict was there when
I pulled down the code. I think it's a fairly new function.

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of sj
Sent: Thursday, August 30, 2007 5:44 PM
To: r-help
Subject: [R] possible bug in vars package (predict.varest) ???


I have been trying to use the predict function in the vars package to
forecast from a seasonal VAR model. The following code sample
illustrates what I am trying to do and the error that I get when trying
to do it.

I run the following code, that results in the following error:


endoC <- Canada[1:72,1:3]
exoC <- Canada[1:72,4]
var.2c <- VAR(endoC, p = 2, season=12,exogen=exoC,type = "const")
exoC_2 <- as.matrix(Canada[73:84,4])

predict(var.2c, n.ahead = 12,dumvar=exoC_2)


Error in as.matrix(cycle, nrow = season, ncol = season - 1) :
        unused argument(s) (nrow = 12, ncol = 11)

from what I can guess, the predict.varest function is using as.matrix()
and passing nrow and ncol, as.matrix() does not take those two
parameters but
matrix() does.

Does anyone have a suggestion of how to get around it? Is there a way I
can get to the predict.varest() function and alter it myself?



	[[alternative HTML version deleted]]

R-help at stat.math.ethz.ch mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.

This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}

More information about the R-help mailing list