Closed USMortality closed 3 months ago
Looks like this may have todo with the column naming. Replacing x/y with something more arbitrary works. Probably an internation collision.
library(fable)
library(tsibble)
library(dplyr)
y <- c(878.6, 866.4, 864.9, 1017.8, 1029.5, 961.5, 896.2)
h <- 2
z <- length(y) - h
df_bl <- tibble(year = seq.int(1, length(y)), asr = y) |> as_tsibble(index = year)
# Split data into training and test
df_train <- df_bl |> filter(year <= z)
df_test <- df_bl |> filter(year > z)
df_train |>
as_tsibble(index = year) |>
model(lm = TSLM(asr ~ trend())) |>
augment()
Not really sure why the agument function fails here:
Just plotting works: