November 2017
Beginner to intermediate
366 pages
7h 59m
English
Non-seasonal time series tend to have a trend component and an error component. We say a trend exists in the time series when there is a long-term increase or decrease in the data. It does not have to be linear.
An additive model is used to estimate the trend of a non-seasonal time series. The time series can be smoothed to remove the trend using methods such as moving averages. The trend can be either increasing or decreasing.
Let us perform smoothing using a simple moving average:
library(TTR)par(mfrow=c(2 ,2))plot(SMA(king.ts, n=2), main = "n=2")plot(SMA(king.ts, n=5), main = "n=5")plot(SMA(king.ts, n=10), main = "n=10")plot(SMA(king.ts, n=15), main = "n=15")par(mfrow=c(1,1)
The TTR library provides the SMA function ...
Read now
Unlock full access