You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear team,
There is a function in timetk ts_impute_vec which is useful for imputing missing or outlier values in time series. The function uses linear interpolation which is a bit subjective at times as it will give extreme values if the data has outliers. My recommendation is you also consider other forms of interpolation like the spline interpolation which comes in handy in cases where the continuity of the time series curvature is important.
Current anyone interested in spline interpolation implement via library(zoo) as below
library(zoo)
ts_data %>%
# Via spline interpolation
mutate(value_spline=ifelse(is.na(value),na.spline(value),value))%>%
# Or the below using ys_impute vec
mutate(value_linear=ifelse(is.na(value),ts_impute_vec(value,period=1),value))
The text was updated successfully, but these errors were encountered:
Dear team,
There is a function in timetk
ts_impute_vec
which is useful for imputing missing or outlier values in time series. The function uses linear interpolation which is a bit subjective at times as it will give extreme values if the data has outliers. My recommendation is you also consider other forms of interpolation like the spline interpolation which comes in handy in cases where the continuity of the time series curvature is important.Current anyone interested in spline interpolation implement via
library(zoo)
as belowThe text was updated successfully, but these errors were encountered: