Fill NA's using a panel regression of specific AR(1) form

Viewed 52

I need to fill NA's using a panel regression of this specific form (AR(1):

Formula

β should be estimated recursively over the sample period. The formula can also be found in Genre et al. (2013), "Combining expert forecasts: Can anything beat the simple Average?" , p.112f.

This is my Data:

         Dez 1999 Mrz 2000 Jun 2000 Sep 2000 Dez 2000 Mrz 2001 Jun 2001 Sep 2001
 [1,]      1.2      1.4      1.5      1.8      1.9      1.9      2.0      1.9
 [2,]      1.2      1.2       NA      1.6       NA      2.0       NA      2.5
 [3,]      1.3      1.7       NA      1.7      1.8      1.5      1.8      1.5
 [4,]      1.1      1.4      1.4      1.5      1.6      1.6      1.7      1.9
 [5,]      1.6      1.9      1.5      1.4      1.3      0.9       NA      1.7
 [6,]      0.9      1.8      1.6       NA       NA      1.8      1.8      1.8
 [7,]      1.4      1.8       NA      1.6      1.8      1.7       NA      1.8
 [8,]      1.4      1.3      1.7      1.5      1.6      1.5      1.9      1.6
 [9,]      1.8      2.0      1.9      1.9      1.8      1.8      2.2      2.0
[10,]      1.3      1.7      1.6      1.6      1.6      1.8      2.1      1.7
[11,]      1.0       NA      1.7      1.7       NA       NA       NA      1.7

I found the imputeTS package in R , but I dont know if it can help me.

1 Answers

imputeTS might help you here, but might not be exactly what you are looking for. The na_kalman function provides imputation by Kalman Smoothing on the state space representation of an ARIMA model. You can build a AR(1) - autoregressive model of order 1, which means a ARIMA(1,0,0) model and give it to the na_kalman function.

library(imputeTS)

# You need to transpose rows/columns to use imputeTS
yourdata <- t(initialdata)

# Create AR(1) model
usermodel <- arima(yourdata, order = c(1, 0, 0))$model

# Use model for imputation
na_kalman(yourdata, model = usermodel)

So this would use a AR(1) model for each of your individuals.

enter image description here

Thus, this model would employ inter-time correlations for each individual separately. But would not use possible information from inter-individual correlations for imputation. So you see, the package specializes on univariate time series imputation. Wasn't able to find you paper (maybe also post a doi) to take a closer look, but right now I wouldn't have a suggestion for a package, which has a easy to use imputation function with your desired model.

Related