Uses a fitted model to interpolate missing values from a dataset.

# S3 method for mdl_df
interpolate(object, new_data, ...)

# S3 method for mdl_ts
interpolate(object, new_data, ...)

Arguments

object

A mable containing a single model column.

new_data

A dataset with the same structure as the data used to fit the model.

...

Other arguments passed to interpolate methods.

Examples

if (requireNamespace("fable", quietly = TRUE)) { library(fable) library(tsibbledata) # The fastest running times for the olympics are missing for years during # world wars as the olympics were not held. olympic_running olympic_running %>% model(TSLM(Time ~ trend())) %>% interpolate(olympic_running) }
#> New names: #> * interpolated1 -> interpolated1...1 #> * interpolated2 -> interpolated2...2 #> * interpolated3 -> interpolated3...3 #> * interpolated4 -> interpolated4...4 #> * interpolated5 -> interpolated5...5 #> * ...
#> # A tsibble: 312 x 4 [4Y] #> # Key: Length, Sex [14] #> Length Sex Year Time #> <int> <chr> <int> <dbl> #> 1 100 men 1896 12 #> 2 100 men 1900 11 #> 3 100 men 1904 11 #> 4 100 men 1908 10.8 #> 5 100 men 1912 10.8 #> 6 100 men 1916 10.8 #> 7 100 men 1920 10.8 #> 8 100 men 1924 10.6 #> 9 100 men 1928 10.8 #> 10 100 men 1932 10.3 #> # … with 302 more rows