R-alpha: tsp problem

Paul Gilbert (pgilbert@bank-banque-canada.ca)
Thu, 4 Apr 1996 11:28:56 -0500

Date: Thu, 4 Apr 1996 11:28:56 -0500
From: pgilbert@bank-banque-canada.ca (Paul Gilbert)
To: R-testers@stat.math.ethz.ch
Subject: R-alpha: tsp problem
Message-Id: <96Apr4.112451est.29451@mailgate.bank-banque-canada.ca>

Here is a simple example of the tsp problem I'm having:

>  x <- 1:100
> x <- cbind(x, .5*x+ rnorm(100), .3*x+ rnorm(100))
> y <- x[,1:2] + matrix(rnorm(200), 100,2)
> b <- lsfit(x[1:90,],y[1:90,])
> y <- ts(y, start=c(1961,1), freq=12)
> b <- lsfit(x[1:90,],y[1:90,])
Error: invalid time series parameters specified

by putting browser() lines in lsfit (I sure would appreciate it if
someone could tell me a better way to find where things are going
wrong) I narrowed this down to

> z <- y[1:90,]
> storage.mode(z) <- "double"
Error: invalid time series parameters specified


> tsp(y)
[1] 1961.00 1969.25   12.00

Splus returns NULL (as per the "Blue Book" non-time series) for
> tsp(y[1:90,])
[1]  1 90  1

and for
> tsp(1:10)
[1]  1 10  1

I think NULL would be safer. It is of course possible to do something
better, but this is only one example of the many ways tsp is
deficient.  I think it would be best to just use the "Blue Book" tsp
and do something else better. (I'm not the only one thinking of a
complete re-write of time representation. I believe both the Federal
Reserve Board in the States, and StatSci, also have plans.)

r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch