Problem 2
Consider local level model for Johnson and Johnson’s earnings per share from Tsay we looked at in class.

(a) Examine a 16 period ahead forecast from this model. Does it look plausible? Hint: Note that earnings per share are growing over time, thus local linear trend model is more appropriate than local level model.
## , , 1
##
## level sea_dummy1 sea_dummy2 sea_dummy3
## level 1 0 0 0
## sea_dummy1 0 -1 -1 -1
## sea_dummy2 0 1 0 0
## sea_dummy3 0 0 1 0
## , , 1
##
## [,1] [,2]
## level 1 0
## sea_dummy1 0 1
## sea_dummy2 0 0
## sea_dummy3 0 0
## , , 1
##
## level sea_dummy1 sea_dummy2 sea_dummy3
## [1,] 1 1 0 0
## , , 1
##
## [,1] [,2]
## [1,] NA 0
## [2,] 0 NA
## , , 1
##
## [,1]
## [1,] NA
## [1] -5.243001 -7.059233 -14.832445
## , , 1
##
## [,1] [,2]
## [1,] 0.005284377 0.0000000000
## [2,] 0.000000000 0.0008594368
## , , 1
##
## [,1]
## [1,] 3.617019e-07
## [1] "level" "sea_dummy1" "sea_dummy2" "sea_dummy3"

The forecast looks resonable BUT it does not seem to be following the existing trend that is present in this data set.
(b) Modify the model from local level to local linear trend. Hint: You need to change the degree input in SSMtrend component to 2, change Q into a list with two NAs, and change y.updatefn appropriately.
## , , 1
##
## level slope sea_dummy1 sea_dummy2 sea_dummy3
## level 1 1 0 0 0
## slope 0 1 0 0 0
## sea_dummy1 0 0 -1 -1 -1
## sea_dummy2 0 0 1 0 0
## sea_dummy3 0 0 0 1 0
## , , 1
##
## [,1] [,2] [,3]
## level 1 0 0
## slope 0 1 0
## sea_dummy1 0 0 1
## sea_dummy2 0 0 0
## sea_dummy3 0 0 0
## , , 1
##
## level slope sea_dummy1 sea_dummy2 sea_dummy3
## [1,] 1 0 1 0 0
## , , 1
##
## [,1] [,2] [,3]
## [1,] NA 0 0
## [2,] 0 NA 0
## [3,] 0 0 NA
## , , 1
##
## [,1]
## [1,] NA
## [1] -6.663743 -12.139869 -6.917747
## , , 1
##
## [,1] [,2] [,3]
## [1,] 0.00127636 0.00000e+00 0.0000000000
## [2,] 0.00000000 5.34222e-06 0.0000000000
## [3,] 0.00000000 0.00000e+00 0.0009900582
## , , 1
##
## [,1]
## [1,] 0.0009900582
## [1] "level" "slope" "sea_dummy1" "sea_dummy2" "sea_dummy3"
(c) Plot the smoothed level component and smoothed seasonal component.

(d) Create and plot a 16 period ahead forecast. Does it look more plausible than the one in part (a)?

In the above set of plots, the top plot represents using trend modeling and the coresponding forecast. This is indeed an improvement over the level based model wheich is the second plot of the above two.