Message-ID: <4B07299E.3040308@gmail.com>
Date: 2009-11-20T23:43:26Z
From: Samik Raychaudhuri
Subject: How to setup the tsp attribute of a dataset
In-Reply-To: <971536df0911201525g260e25a6ld04cbe3cd52d0435@mail.gmail.com>
Looks like there is a difference between when I use frequency(x) vs.
when I use frequency(x.ts). If I try to get the tsp attribute of x by
using attr(x, "tsp"), it still shows up as NULL. When I looked at the
code of frequency() function (in stats), it seems to be looking at
attr(x, "tsp"), which is NULL, so the function returns 1.
Let me relate the context a bit. I am trying to use the function
forecast:nsdiffs to perform a Canova-Hansen test for a given dataset.
Even though I specify the seasonality, in an internal function,
frequency(x) is used to find seasonality, and since that value is 1 (as
I explained above: it looks at attr(x, "tsp")), the calculations do not
succeed.
On 11/20/2009 4:25 PM, Gabor Grothendieck wrote:
> Not for me.
>
>
>> x <- 1:100
>> x.ts <- ts(x, start = 1, frequency = 4)
>> frequency(x.ts)
>>
> [1] 4
>
>
>
>