Closed GreatEmerald closed 4 years ago
Another thing to look at would be the timsac::decomp
function as another alternative to stl
. It also allows NA
values, but I haven't tested how.
stlplus has been implemented, including s toggle switch to base stl.
NA
values are a problem in time series analysis for seasonality and trend calculation. What is worse is that they tend to be temporally biased towards the rainy period, and we might have no observations whatsoever over the entire time series during particular times. This means that if we just omit the time steps withNA
s, the trend estimation will also be biased towards values in the dry season.There was also the matter of the
stl
package not handling data withNA
values altogether.One workaround (suggested by Achim) was to use
bfastpp
instead ofstl
to get simplified covariates, and then calculate the trend manually. Another is to usestlplus
, but that imputes values. Discussion about the pros and cons and how to communicate that would be welcome.