Skip to content

STL with window="periodic" not correct #155

@robjhyndman

Description

@robjhyndman

These two graphs should be the same. The second seems to leave a lot of the seasonality in the remainder series.

library(fpp3)
library(rdwd)

df <-
  readDWD(dataDWD(
    selectDWD(
      name = "Jena (Sternwarte)",
      res = "daily",
      var = "kl",
      per = "historical"
    ),
    read = FALSE
  ), varnames = TRUE) |> 
  tibble() %>%
  mutate(date = as.Date(MESS_DATUM)) %>%
  filter(date >= as.Date("2005-01-01")) %>%
  rename(temperature = TMK.Lufttemperatur) |> 
  as_tsibble(index = date) %>%
  select(date, temperature) 

df |> 
  model(STL(temperature ~ season(period = "year", window=999999), robust = TRUE)) |>
  components() |>
  autoplot()

df |> 
  model(STL(temperature ~ season(period = "year", window="periodic"), robust = TRUE)) |>
  components() |>
  autoplot()

Created on 2022-10-26 with reprex v2.0.2

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions