LmSeasonalCycle {greenbrown}R Documentation

Calculate the mean seasonal cycle of a time series based on a linear model

Description

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).

Usage

LmSeasonalCycle(ts)

Arguments

ts

univariate time series of class ts

Value

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.

Author(s)

Matthias Forkel <matthias.forkel@geo.tuwien.ac.at> [aut, cre]

See Also

Decompose, TrendSeasonalAdjusted, MeanSeasonalCycle

Examples

# 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")


[Package greenbrown version 2.4.3 Index]