[R] Query on multivariate time series

Spencer Graves spencer.graves at pdf.com
Wed Mar 1 04:40:06 CET 2006


	  As I read the model you described, it is NOT a multivariate 
autoregression but a univariate autoregression with explanatory 
variables and some parameters fixed.  The "arima" command should be able 
to fit this.  Try the following:

set.seed(1)
X <- rnorm(99)
X2 <- cbind(x=X[-1], x1=X[-99])
head(X2)
fit1 <- arima(LakeHuron, order = c(4,0,0),xreg = X2)

b1a <- coef(fit1)
b1a[1:2] <- 0
b1a[-(1:2)] <- NA
fit1a <- update(fit1, fixed=b1a)

	  If this does NOT answer your question, please submit another 
question.  However, if you want to increase your chances of receiving a 
more useful reply quicker, I suggest you first read the posting guide! 
"www.R-project.org/posting-guide.html".

	  hope this helps.
	  spencer graves

Pradeep Gunda wrote:

> Hi,
> 
> Could anyone inform how to perform multi-variate auto regression using
> the past 't' values for regression in R. I have looked at ARMA
> provided by DES library and mvr provided by PLS library but could not
> match them to my requirements.
> 
> Specifically, I want the following
> 
> Say I have attributes a1-a4. and the regression equation is as follows:
> 
> a4(t) = alpha1*a1(t-X)+alpha2*a2(t-X)+alpha3*a3(t-X)+alpha4*a1(t-X-1)+alpha5*a2(t-X-1)...
>              alphan*a3(t-2X)
> 
> where X is the window length of the time series.
> 
> Thanks,
> Pradeep
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list