# predictive models for panel data

I came across some practical problems with the data in similar form: item*features*time.

Traditionally, data for predictive models in textbook is only item*features, and we use features to make prediction. item are usually iid.

I am confused with this kind(item*features*time) of data at first until somebody told me that this is called panel data. This remind me that I saw this concept in some econometrics book. However, most econometrics are linear models.

Given that we have tons of predictive models today(like LASSO, RT, GBM, SVM, even deep learning), my question is that is there any way to build predictive models for panel data? Are there any good references?

Some practical fact of the data:

• It is not i.i.d, so observations with nearer time may have some correlations, or some relationship, which we may make use of in the predictive model. Also, sometimes, the items are related, the relationship between the items may also need to take into consideration.

• Can I force to make this 3-D data into 2-D, by melting item*features as one long observations, so that the data becomes observation*features, which is in traditional text book shape? Will the result for this good or meaningful?

• I was wondering what you decided to use for this? Trying to solve a similar problem.
– sjw
Jan 7, 2017 at 1:21
• finance and climate Jan 7, 2017 at 1:25
• Medical, here. Did you find a solution or references?
– sjw
Jan 7, 2017 at 1:27
• company * fundamental factors * time, station * climate variables * time Jan 7, 2017 at 1:27
• No. I did not find a good solution. Jan 7, 2017 at 1:29

Check out this publication:

Pargent, F., & Albert-von der Gönna, J. (2018). Predictive Modeling With Psychological Panel Data. Zeitschrift Für Psychologie, 226(4), 246–258. https://doi.org/10.1027/2151-2604/a000343

When you have panel data, there are a different tasks that you can try to solve. And for each task, there are numerous approaches to solve it. Econometricians are typically interested in panel forecasting. Other common tasks are time series classification or regression.

When you want to use machine learning methods to solve panel forecasting, there are a number of approaches:

Regarding your input data (X), treating units (what you call items) as i.i.d. samples, you can

• bin the time series and treat each bin as a separate column, ignoring any temporal ordering, with equal bins for all units, the bin size could of course simply be the observed time series measurement, or you could upsample and aggregate into larger bins, then use standard machine learning algorithms for tabular data,
• or extract features from the time series for each unit, and use each extracted feature as a separate columns, again combined with standard tabular algorithms,
• or use specialised time series regression/classification algorithms depending on whether you observe continuous or categorical time series data.

Regarding your output data (y), if you want to forecast multiple time points in the future, you can

• fit an estimator for each step ahead that you want to forecast, always using the same input data,
• or fit a single estimator for the first step ahead and in prediction, roll the input data in time, using the first step predictions to append to the observed input data to make the second step predictions and so on.

All of the approaches above basically reduce the panel forecasting problem to a time series regression or tabular regression problem. Once your data is in the time series or tabular regression format, you can also append any time-invariant features for users.

Of course there are other options to solve the panel forecasting problem, like for example using classical forecasting methods like ARIMA adapted to panel data or deep learning methods that allow you to directly make sequence to sequence predictions.

Lots of good references:

Gelman and Hill, Data Analysis Using Regression and Multilevel/Hierarchical Models

Pesaran, H. M., Time Series and Panel Data Econometrics

Gelman and Hill's book is more applied while Pesaran has made original contributions by developing and extending classic univariate time series tests for stationarity, autoregression, unit roots, weak dependence between cross-sections, and so on, to panel data models.