50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

astsa (version 1.15)

trend: Estimate Trend

Description

Estimates the trend (polynomial or lowess) of a time series and returns a graphic of the series with the trend and error bounds superimposed.

Usage

trend(series, order = 1, lowess = FALSE, lowspan = 2/3, col = c(4, 6), ylab = NULL, ...)

Value

Produces a graphic and returns the trend estimate and error bounds invisibly (see details).

Arguments

series

The time series to be analyzed (univariate only).

order

Order of the polynomial used to estimate the trend with a linear default (order=1) unless lowess is TRUE.

lowess

If TRUE, lowess is used to find the trend. The default is FALSE.

lowspan

The smoother span used for lowess.

col

For the graphic, the color of the data (default is 4) and the color of the trend (default is 6).

ylab

Label for the vertical axis (default is the name of the series).

...

Other graphical parameters.

Author

D.S. Stoffer

Details

Produces a graphic of the time series with the trend and a .95 pointwise confidence interval superimposed. The trend estimate and the error bounds are returned invisibly.

References

You can find demonstrations of astsa capabilities at FUN WITH ASTSA.

The most recent version of the package can be found at https://github.com/nickpoison/astsa/.

In addition, the News and ChangeLog files are at https://github.com/nickpoison/astsa/blob/master/NEWS.md.

The webpages for the texts are https://www.stat.pitt.edu/stoffer/tsa4/ and https://www.stat.pitt.edu/stoffer/tsda/.

See Also

detrend

Examples

Run this code
if (FALSE) {
trend(soi)

trend(soi, lowess=TRUE)
}

Run the code above in your browser using DataLab