[R] decomposing an irregularly spaced time series
kchamberln at gmail.com
Sun Feb 28 22:54:00 CET 2010
I would first abandon time-domain techniques altogether for irregularly spaced series. The Lomb Scargle periodogram is available for R, here: http://research.stowers-institute.org/efg/2005/LombScargle/R/index.htm.
From: ravi [mailto:rv15i at yahoo.se]
Sent: Friday, February 26, 2010 3:05 PM
To: r-help at r-project.org
Subject: [R] decomposing an irregularly spaced time series
I am interested in decomposing an irregularly spaced time series and getting results similiar to that obtained with the stl command for a regularly spaced time series. I would like to know if any of the time series packages like zoo can be used for this. From my search, I was only able to find some help with the tseries and pastecs passages, But I had difficulty in going the full length even with these packages . Let me explain with my sample code :
# Attemts with the functions irts, regul and tsd
t1 <- runif(n)
u <- rnorm(n)
x <- irts(t3, u) # could not find a decomposition method for irts
I get the following error message :
Error in approx(x, y, xout, method = "linear", rule = rule) :
need at least two non-NA values to interpolate
I would like to get help on the following points :
1. The actual decomposition is suposed to work with the tsd command. Is it possible to use it without first using regul?
2. Can I succeed with the regul command by a better choice of argument values? My attempts to set rule=2 did not help.
3. Would it be better to first get a regularly spaced time series by interpolation, and then try decompostion with stl?
I would appreciate some practical help here.
4.Is it hopeless to attemt decomposition when the irregularity level is high? The series that I am working on is fairly regular in periods interpersed with either breaks or irregular data. I would like to see the trends and seasonal effects there.
Is there an alternative method of approaching this task?
More information about the R-help