tidyverts / tidyverts/fabletools

forecast with reconciliation does not work in time series with only one non-zero observation

Open
#309 1 comment 0 reactions 1 assignee View on GitHub

@mitchelloharawild is already working on this.

Since Apr 6, 2021.

Dominant language
R
Stars
98
Forks
37
PR merge metrics
No merged PRs in 30d

Description

I am trying to run an experiment where I have time series that contains only one non-zero observation.

Th experiment runs for the following example where I have two non-zero observations:

library(fpp3)
tibble(
  y = c(3,rep(0,198),1),
  key = c(rep("A",100),rep("B",100)),
  t = c(seq(100),seq(100))
) %>%
  as_tsibble(key=key, index=t) %>%
  aggregate_key(key, y=sum(y)) %>%
  model(ets=ETS(y)) %>%
  reconcile(mint = min_trace(ets, method="mint_shrink")) %>% 
  forecast(h=7)

The following example contains a time series with only one non-zero observation, when I run the experiment I get an error:

library(fpp3)
tibble(
  y = c(3,rep(0,198),0),
  key = c(rep("A",100),rep("B",100)),
  t = c(seq(100),seq(100))
) %>%
  as_tsibble(key=key, index=t) %>%
  aggregate_key(key, y=sum(y)) %>%
  model(ets=ETS(y)) %>%
  reconcile(mint = min_trace(ets, method="mint_shrink")) %>% 
  forecast(h=7)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.