Applies a model-specific estimation technique to predict the values of missing values in a tsibble
, and replace them.
# S3 method for class 'model_mean'
interpolate(object, new_data, specials, ...)
A model for which forecasts are required.
A tsibble containing the time points and exogenous regressors to produce forecasts for.
(passed by fabletools::forecast.mdl_df()
).
Other arguments passed to methods
A tibble of the same dimension of new_data
with missing values interpolated.
library(tsibbledata)
olympic_running %>%
model(mean = MEAN(Time)) %>%
interpolate(olympic_running)
#> # 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.3
#> 7 100 men 1920 10.8
#> 8 100 men 1924 10.6
#> 9 100 men 1928 10.8
#> 10 100 men 1932 10.3
#> # ℹ 302 more rows