TSSS (version 1.3.4-5)

trend: Trend Estimation

Description

Estimate the trend by state space model.

Usage

trend(y, trend.order = 1, tau2.ini = NULL, delta, plot = TRUE, ...)

Value

An object of class "trend", which is a list with the following components:

trend

trend component.

residual

residuals.

tau2

variance of the system noise \(\tau^2\).

sigma2

variance of the observational noise \(\sigma^2\).

llkhood

log-likelihood of the model.

aic

AIC.

cov

covariance matrix of smoother.

Arguments

y

a univariate time series.

trend.order

trend order.

tau2.ini

initial estimate of variance of the system noise \(\tau^2\). If tau2.ini = NULL, the most suitable value is chosen in \(\tau^2 = 2^{-k}\).

delta

search width (for tau2.ini is specified (not NULL)) .

plot

logical. If TRUE (default), trend component and residuals are plotted.

...

graphical arguments passed to plot.trend.

Details

The trend model can be represented by a state space model

$$x_n = Fx_{n-1} + Gv_n,$$ $$y_n = Hx_n + w_n,$$

where \(F\), \(G\) and \(H\) are matrices with appropriate dimensions. We assume that \(v_n\) and \(w_n\) are white noises that have the normal distributions \(N(0,\tau^2)\) and \(N(0, \sigma^2)\), respectively.

References

Kitagawa, G. (2020) Introduction to Time Series Modeling with Applications in R. Chapman & Hall/CRC.

Examples

Run this code
# The daily maximum temperatures for Tokyo
data(Temperature)
trend(Temperature, trend.order = 1, tau2.ini = 0.223, delta = 0.001)

trend(Temperature, trend.order = 2)

Run the code above in your browser using DataLab