decloess {pastecs} | R Documentation |
Time series decomposition by the LOESS method
Description
Compute a seasonal decomposition of a regular time series using a LOESS method (local polynomial regression)
Usage
decloess(x, type="additive", s.window=NULL, s.degree=0, t.window=NULL,
t.degree=2, robust=FALSE, trend=FALSE)
Arguments
x |
a regular time series ('rts' under S+ and 'ts' under R) |
type |
the type of model. This is for compatibility purpose. The only model type that is accepted for this method is |
s.window |
the width of the window used to extract the seasonal component. Use an odd value equal or just larger than the number of annual values (frequency of the time series). Use another value to extract other cycles (circadian, lunar,...). Using |
s.degree |
the order of the polynome to use to extract the seasonal component (0 or 1). By default |
t.window |
the width of the window to use to extract the general trend when |
t.degree |
the order of the polynome to use to extract the general trend (0, 1 or 2). By default |
robust |
if |
trend |
If |
Details
This function uses the stl()
function for the decomposition. It is a wrapper that create a 'tsd' object
Value
a 'tsd' object
Author(s)
Philippe Grosjean (phgrosjean@sciviews.org), Frédéric Ibanez (ibanez@obs-vlfr.fr)
References
Cleveland, W.S., E. Grosse & W.M. Shyu, 1992. Local regression models. Chapter 8 of Statistical Models in S. J.M. Chambers & T.J. Hastie (eds). Wadsworth & Brook/Cole.
Cleveland, R.B., W.S. Cleveland, J.E. McRae, & I. Terpenning, 1990. STL: A seasonal-trend decomposition procedure based on loess. J. Official Stat., 6:3-73.
See Also
tsd
, tseries
, decaverage
, deccensus
, decmedian
, decdiff
, decevf
, decreg
Examples
data(releve)
melo.regy <- regul(releve$Day, releve$Melosul, xmin=9, n=87,
units="daystoyears", frequency=24, tol=2.2, methods="linear",
datemin="21/03/1989", dateformat="d/m/Y")
melo.ts <- tseries(melo.regy)
melo.dec <- decloess(melo.ts, s.window="periodic")
plot(melo.dec, col=1:3)