Skip to content

ts or xts with high-frequency data within a year

5 messages · Ryan Utz, Bert Gunter, Joshua Ulrich +1 more

#
Hello,

I have a time series that represents data sampled every 15-minutes. The
data currently run from November through February, 8623 total readings.
There are definitely daily periodic trends and non-stationary long-term
trends. I would love to decompose this using basic time series analysis.

However, every time I attempt decomposition, I get the

Error in decompose( ) : time series has no or less than 2 periods

Is it only possible to do basic time-series analysis if you have a year or
more worth of data? That seems absurd to me, since there is definite
periodicity and the data are a time series. I have tried every manner of
specifying frequency= with no luck (96 does not work). All manner of
searching for help has turned up fruitless.

Can I only do this after I wait another year or two?

Thanks,
Ryan
#
Code please.

Reproducible example?(e.g. 1st 100 values)

"PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code."

Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Wed, Mar 30, 2016 at 8:03 AM, Ryan Utz <utz.ryan at gmail.com> wrote:
#
I "think" the problem is that you failed to set the "frequency"
attribute of your time series, so it defaults to 1. A time series with
one observation per period cannot be decomposed, since the error term
is confounded with the "seasonality", which is essentially your error
message.

Again, a guess, as you provided no code.

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Wed, Mar 30, 2016 at 8:18 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote:
#
On Wed, Mar 30, 2016 at 10:29 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote:
Another guess is that you're running into issues with converting xts
to/from ts.  That currently doesn't work well, so you should convert
to zoo and make sure your frequency attribute makes sense before
attempting to decompose.

  
    
#
You said you specified frequency=96 when you constructed the time
series, but when I do that the decomposition looks reasonable:
rnorm(length(time),0,.3)
How is your code different from the above?



Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, Mar 30, 2016 at 8:03 AM, Ryan Utz <utz.ryan at gmail.com> wrote: