Re: [R] Semi-Regular Time Series with Missing Values

2011-01-19 Thread Adam Oliner
I don't seem to have that method: zts = as.ts.zoo(z) Error: could not find function as.ts.zoo I'm finding forum posts from people trying to use stl directly with zoo[reg] functions (despite the documentation specifying ts) but discovering that stl gives errors with NA entries. I encountered

Re: [R] Semi-Regular Time Series with Missing Values

2011-01-19 Thread Gabor Grothendieck
On Wed, Jan 19, 2011 at 1:10 PM, Adam Oliner oli...@gmail.com wrote: I don't seem to have that method: zts = as.ts.zoo(z) Error: could not find function as.ts.zoo I'm finding forum posts from people trying to use stl directly with zoo[reg] functions (despite the documentation specifying ts)

Re: [R] Semi-Regular Time Series with Missing Values

2011-01-19 Thread Gabor Grothendieck
On Wed, Jan 19, 2011 at 3:07 PM, Adam Oliner oli...@gmail.com wrote: This still does not give me the desired behavior: z = zoo(x, order.by=t, frequency=24) t = as.ts(z) ... inserts 23 NA values between every actual value. This is not correct; the original data has a frequency of 24 and

Re: [R] Semi-Regular Time Series with Missing Values

2011-01-19 Thread Adam Oliner
This still does not give me the desired behavior: z = zoo(x, order.by=t, frequency=24) t = as.ts(z) ... inserts 23 NA values between every actual value. This is not correct; the original data has a frequency of 24 and doesn't need one forced upon it during coercion. z = zoo(x, order.by=t) t =

Re: [R] Semi-Regular Time Series with Missing Values

2011-01-19 Thread Adam Oliner
Gabor, If you follow those steps on a series with missing values, the resulting tt will contain tons of new NAs. (See my original email and the call to zrt = as.ts(zr).) At any rate, I finally managed to finagle a ts with the correct frequency by coercing to ts _twice_ and specifying the

Re: [R] Semi-Regular Time Series with Missing Values

2011-01-19 Thread Gabor Grothendieck
On Wed, Jan 19, 2011 at 4:17 PM, Adam Oliner oli...@gmail.com wrote: Gabor, If you follow those steps on a series with missing values, the resulting tt will contain tons of new NAs. (See my original email and the call to zrt = zoo and zooreg classes handle series which may not be regularly

Re: [R] Semi-Regular Time Series with Missing Values

2011-01-19 Thread Gabor Grothendieck
On Wed, Jan 19, 2011 at 4:27 PM, Adam Oliner oli...@gmail.com wrote: My series was regularly spaced, it simply contained missing values. I don't see why the new values were added. Besides, my previous email showed exactly how to convert a zoo object with Please provide a minimal

Re: [R] Semi-Regular Time Series with Missing Values

2011-01-19 Thread Adam Oliner
My series was regularly spaced, it simply contained missing values. I don't see why the new values were added. Besides, my previous email showed exactly how to convert a zoo object with missing values into a ts object with missing values and a frequency other than 1, so I'm not sure what you

Re: [R] Semi-Regular Time Series with Missing Values

2011-01-19 Thread Adam Oliner
The objective is to get the stl calls to work without making up values for the NAs: library(zoo) data = c(50, 32, 22, 13, 14, 6, 12, 3, 6, 21, NA, NA, 15, 13, 17, 9, 11, 34, 63) dataz = zoo(data, 1:length(data)) t = as.ts(dataz) datat = as.ts(dataz) datatt = ts(t, frequency=2) frequency(datatt)

Re: [R] Semi-Regular Time Series with Missing Values

2011-01-19 Thread Gabor Grothendieck
On Wed, Jan 19, 2011 at 5:21 PM, Adam Oliner oli...@gmail.com wrote: The objective is to get the stl calls to work without making up values for the NAs: library(zoo) data = c(50, 32, 22, 13, 14, 6, 12, 3, 6, 21, NA, NA, 15, 13, 17, 9, 11, 34, 63) dataz = zoo(data, 1:length(data)) t =

Re: [R] Semi-Regular Time Series with Missing Values

2011-01-19 Thread Adam Oliner
Gabor, On Wed, Jan 19, 2011 at 3:36 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: stl does not support series with NAs Thank you. This is what I needed to know. Cheers, -- - Adam J. Oliner [[alternative HTML version deleted]]

Re: [R] Semi-Regular Time Series with Missing Values

2011-01-19 Thread Adam Oliner
Whoops, fixed a typo: library(zoo) data = c(50, 32, 22, 13, 14, 6, 12, 3, 6, 21, NA, NA, 15, 13, 17, 9, 11, 34, 63) dataz = zoo(data, 1:length(data)) datat = as.ts(dataz) datatt = ts(datat, frequency=2) frequency(datatt) length(datatt) # these all give errors stl(datatt, s.window=per) # this next

Re: [R] Semi-Regular Time Series with Missing Values

2011-01-18 Thread Gabor Grothendieck
On Tue, Jan 18, 2011 at 6:33 PM, Adam Oliner oli...@gmail.com wrote: Hi, I'm trying to make a ts object that has both NA values and a frequency other than 1 (so I can use stl). I've tried all permutations I can think of, but cannot get the desired (expected?) results. The values live in x