tidyverts / tidyverts/fable

Interpolation of irregular time series

Open
#256 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
588
Forks
71
Avg merge
1h 58m
Merged PRs (30d)
1

Description

This issue refers to a communicatio with Rob Hyndman started on stackoverflow.

https://stackoverflow.com/questions/61078446/interpolation-of-irregular-time-series-with-r

I'm looking for a way to interpolate irregular time series data where the timestamp is POSIXct (rather than a date).

Rob proposed following solution, which does not seem to work with the example df I created.

library(tidyverse)
library(tsibble)
library(fable)

df <- tibble(date = as.POSIXct(c("2000-01-01 00:00", "2000-01-02 01:00", "2000-01-05 00:00")),
             value = c(1,NA,2)) %>%
  as_tsibble(index = date) %>%
  fill_gaps()


df %>%
  model(naive = ARIMA(value ~ -1 + pdq(0,1,0) + PDQ(0,0,0))) %>%
  interpolate(df)

# Error in UseMethod("interpolate") : 
#  no applicable method for 'interpolate' applied to an object of class "null_mdl"
# In addition: Warning messages:
# 1: It looks like you're trying to fully specify your ARIMA model but have not said if a constant # should be included.
# You can include a constant using `ARIMA(y~1)` to the formula or exclude it by adding `ARIMA(y~0)`. 
# 2: 1 error encountered for naive
# [1] Could not find an appropriate ARIMA model.
# This is likely because automatic selection does not select models with characteristic roots that may # be numerically unstable.
# For more details, refer to https://otexts.com/fpp3/arima-r.html#plotting-the-characteristic-roots

Thanks for taking a look again!

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.

Research direction

Start by reproducing the provided R example from the Stack Overflow discussion, following the as_tsibble, fill_gaps, ARIMA, and interpolate calls. Trace why the model becomes null_mdl with POSIXct timestamps and determine whether irregular time-series interpolation is supported; done means the example works or the limitation is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.