Hi everyone,
I have as an example this time series data (boston) where I want to estimate and plot the trend component, the seasonal component, and the remainder (residual component). I did it like this:
install.packages("fma")
library(fma)
plot(stl(boston[,1], s.window = "per"))
plot(stl(boston[,2], s.window = "per"))
Now I would like to split the data into two consecutive time intervals, where the second interval should contain about 1/4 of "boston".
The first interval will be used to estimate a model, and the second interval is used for prediction, which then can be compared to the data. For this purpose, I would like to visualize the first part of my time series with plot()
, but enlarge the x-range in order to add a line for the second part later on. However, I am stuck here and don't know how to really proceed. Any help is appreciated.