0

I'm trying to fit and forecast TSLM models with different time-t predictors added alongside the trend... for reasons I don't understand, several of the models yield identical predictions even though the the input test data appears different, and the coefficients in the models themselves appear different. Almost certainly this an error on my part.. let me know what's going wrong!

Reprex data

suppressPackageStartupMessages({
    library(tidyverse)
    library(tsibble)
    library(fable)
    library(feasts)
})

proj_tract <- read_csv("path_to_reprexdata")

proj_tract <- as_tsibble(proj_tract, key = tractid, index = year)

train <- proj_tract %>%
    filter(year < 2019) 

test <- proj_tract %>%
    filter(year >= 2019) 

fit <- train %>%
    model(
        trend_only = TSLM(log(chh) ~ trend()),
        trend_w_dar = TSLM(log(chh) ~ trend() + log(ig_count_imptd)),
        trend_w_da1 = TSLM(log(chh) ~ trend() + log(prd_1)),
        trend_w_da2 = TSLM(log(chh) ~ trend() + log(prd_2)),
        trend_w_da3 = TSLM(log(chh) ~ trend() + log(prd_3)),
        trend_w_da4 = TSLM(log(chh) ~ trend() + log(prd_4)),
        trend_w_da5 = TSLM(log(chh) ~ trend() + log(prd_glmnet))
    )

fc <- forecast(
    fit,
    new_data = test
) %>% 
    hilo(.95)

res <- fc %>% 
    as_tibble() %>%
    rename("proj" = ".mean", "model" = ".model") %>%
    select(model, proj, lchh) %>%
    pivot_wider(names_from = model, values_from = proj)
head(res)

A subset of these models yield identical predictions -- help me understand why!

ADF
  • 522
  • 6
  • 14
  • your logs of prd_1, prd_2 etc are almost the same and have a small influence on the prediction. Also you only have 9 observations per tractid, very limited data to work with. – phiver Nov 12 '21 at 20:03
  • Certainly this is a data-poor forecasting scenario, but should that really yield identical predictions down to the 6th decimal place? Maybe it does and I need to work through the math. – ADF Nov 12 '21 at 20:21

0 Answers0