5
$\begingroup$

I am doing a univariate time series analysis on regional sea-surface temperatures which has missing data, and I am thinking about using the R package, 'imputeTS.' My model is simple, it has MA errors and a term linear in time. I would like to impute the missing data, but I am not sure which package method to use. Also, I am not sure how the error from the imputation would affect the SE of the slope. Could someone advise me on which method to use, and how to incorporate the imputation error on the slope? I would greatly appreciate any help.

$\endgroup$
2
$\begingroup$

Generally (without knowing the data itself) I always recommend na.kalman from the imputeTS package.

For using this method the time series should not be too short. (something like 12 values over all does not make too much sense here)

na.kalman is also very good if there is seasonality in the dataset. (From sea-surface temperatures I would expect this)

Another good method if there is seasonality in the dataset is na.seadec.

If you do not choose a completely inadequate imputation algorithm for your dataset (like e.g. mean) this should not affect the SE of the slope too much. There is no extrapolation done. The imputed values should fit to the statistical characteristics of the rest of the data.

But also keep in mind: by doing imputation there is always a risk of introducing error. It is also an option to go on without imputation if you do not necessarily need it. There are for example also established methods to model a time series with missing values (e.g. see Jones, R. H. (1980) Maximum likelihood fitting of ARMA models to time series with missing observations).

In the following a little description, what both mentioned algorithms are doing:

na.kalman

Uses Kalman Smoothing on a State Space Model for imputation.

This follows the following steps:

  1. Get/fit a State Space Model
  2. Estimate the missing values by kalman smoothing.

The State Space Model in step 1 can be a structural time series model obtained by StructTS or the space representation of a ARMA model obtained by auto.arima. A good follow up read is the following:

Harvey, Andrew C. Forecasting, structural time series models and the Kalman filter. Cambridge university press, 1990

na.seadec

Seasonally Decomposed Missing Value Imputation

Inlcludes the following steps

  1. Removes the seasonal component from the time series
  2. Performs imputation on the deseasonalized series with another algorithm (with standard parameters this is linear interpolation)
  3. Add back the seasonal component, which was removed in step 1.

na.interpolation

Missing Value Imputation by Interpolation

Uses either linear, spline or stineman interpolation to replace missing values. Linear interpolation is the default parameter setting. The function internally uses approx for linear, spline for spline or stinterp (from package stinepack).

$\endgroup$
  • $\begingroup$ Thank you very much, I will check out those methods, and I did not know you could even model without imputation, so I will look into that as well. My complete series could have one point for each of 150 years, and 20-30 points can be missing, mainly in the first half. The data typically looks like a stable MA until recent decades, when there possibly is a rise. Would you be able to say if that sounds too extreme for either case, using imputation or modeling with missing values? $\endgroup$ – Shibi Nov 11 '16 at 16:34
  • $\begingroup$ But what do these functions na.kalman, na.seadec do? So far, these are just labels of some procedures in some language. Describe them, their basics or algorithm. $\endgroup$ – ttnphns Nov 11 '16 at 17:30
  • $\begingroup$ @ttnphns good idea, added some sentences in the answer $\endgroup$ – stats0007 Nov 13 '16 at 16:56
  • $\begingroup$ @Shibi oh ok, you have yearly observations. This and your description sound like you do not have seasonality in your data. No this doesn't sound too extreme for both modeling with missing values or imputation. In your case a linear interpolation (na.interpolation) might already be enough and deliver good results. $\endgroup$ – stats0007 Nov 13 '16 at 17:03
  • $\begingroup$ @stats0007 Thanks again for the suggestions and also for the extra descriptions. $\endgroup$ – Shibi Nov 13 '16 at 22:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.