skill_score(MSE)
if (FALSE) { # requireNamespace("fable", quietly = TRUE)
library(fable)
library(tsibble)
lung_deaths <- as_tsibble(cbind(mdeaths, fdeaths))
lung_deaths %>%
dplyr::filter(index < yearmonth("1979 Jan")) %>%
model(
ets = ETS(value ~ error("M") + trend("A") + season("A")),
lm = TSLM(value ~ trend() + season())
) %>%
forecast(h = "1 year") %>%
accuracy(lung_deaths, measures = list(skill = skill_score(MSE)))
}
Run the code above in your browser using DataLab