LmSeasonalCycle {greenbrown} | R Documentation |
The function calculates the mean seasonal cycle of a time series based on a linear regression between the values and the time. Therefore a linear model with interactions is fitted to the original values Y of the form: Y = (a * m) * (b * sin(m)) * (c * cos(m)) + d where m are the the seasonal indices (e.g. months).
LmSeasonalCycle(ts)
ts |
univariate time series of class |
Mean seasonal cycle of time series ts with the same length as ts, i.e. the mean seasonal cycle is repeated for each year. The mean seasonal cycle is centered to 0.
Matthias Forkel <matthias.forkel@geo.tuwien.ac.at> [aut, cre]
Decompose
, TrendSeasonalAdjusted
, MeanSeasonalCycle
# load a time series of Normalized Difference Vegetation Index data(ndvi) plot(ndvi) ndvi.lmcycl <- LmSeasonalCycle(ndvi) plot(ndvi.lmcycl) ndvi.meancycl <- MeanSeasonalCycle(ndvi) plot(ndvi.lmcycl[1:12], col="red", type="l") lines(ndvi.meancycl[1:12], col="blue")