Imputation

Note: this is experimental functionality at this stage

Some time series may have missing values. A missing value is simply a lack of observation at certain points in time. An example may be that an analyst forgot to include the value at some points in time for a time series. Missing values makes it more challenging to create models that require data at all points in time. For this reason, we would like to replace missing values with reasonable “guesses”. This process is called imputation.

Impute

signal.impute(expected_frequency, strategy='unobserved')

Impute missing values in a signal using a certain strategy. Note that the signal must have explicit missing values for this function to work.

Parameters:
  • signal – The signal to calculate.

  • expected_frequency – The expected frequency of the signal. Required to make sure that signals with non-explicit missing values are treated correctly. Values are pandas offset aliases, such as ‘D’, ‘M’, ‘QS’, etc.

  • strategy – One of ‘iterative’ or ‘unobserved’. If ‘iterative’, the missing values are imputed by iterative use of BayesianRidge regression, as specified in https://scikit-learn.org/stable/modules/generated/sklearn.impute.IterativeImputer.html If ‘unobserved’, imputation is performed by training an Unobserved Components Model. The default value is ‘unobserved’.

To impute missing values in a signal using unobserved imputation, call:

signal.impute('D')