I'm looking for a model to learn relationships within and between a set of partially observed time series in order to generate predictions for any timepoint in any of the set of time series.
More specifically, I have data on the proportion of available team minutes played by soccer players (range 0-1), aggregated per year of player age (e.g. 18 y.o., 19 y.o., etc.) and per (binned) Elo (i.e. skill) level of their team (e.g. 70<Elo<=80, 80<Elo<=90, etc.). The data are unavoidably incomplete - a player can only play at one Elo level (i.e. at one team) at any given moment in time - but the aim is to be able to infer what proportion of minutes a player was / is capable of playing at any team level and at any age based upon their observed minutes played thus far in their career.
Attempts so far
Factorisation machines
By representing each player's data as a MxN matrix where M=Elo level bin and N=age like so:
I can use matrix factorisation at each Elo level independently - although the results are not great; e.g. player 10 has been observed (orange points) playing at substantially higher Elo levels than player 23 (blue points), yet the predictions for player 23 at Elo level 90 (blue line) are higher than for player 10 (orange line). A smoother series of predictions at each Elo level would also be desirable, ideally reducing to zero for very low and very high ages.
I also started looking into tensor factorisation (e.g. TensorLy) to fit across all Elo levels simultaneously.
Regression
One key feature of the data remains unaccounted for with factorisation approaches: there is an evident (non-linear) correlation between age and minutes played across all players and Elo levels. Furthermore, there are correlations across Elo levels: e.g. players with a high proportion of minutes played at a medium Elo level at a young age are more likely to play a higher proportion of minutes at a higher Elo level when older. Here's a visual example:
As @leviva suggested below, we can define a regression with quadratic $age$, $Elo$ terms and an $age*Elo$ interaction term like so:
$minutes(age,Elo,player) = a_0 + a_1*age + a_2*Elo + a3*age*Elo + a4*age^2 + a5*Elo^2 + a6*age*Elo$
A nonlinear least squares (stats::nls()
in R) fitted to data generates the following predictions (in blue) for these observations (in red):
I'm currently looking at modelling $player\_id$ as a random effect using nonlinear mixed effect models (e.g. nlme::nlme
in R) to improve predictions by fitting independent intercepts and/or coefficients.
However, these approaches still omit information about the previous observations of minutes played by an individual player (e.g. playing many minutes at a medium team level when young should predict playing more minutes than average at a high team level when older). Therefore, I've tried including lagged terms for minutes played (i.e. proportion of available team minutes played at age t-1, t-2, etc.) and Elo (i.e. skill level of team at age t-1, t-2, etc.) like so:
$minutes_t(age,Elo,player) = a_0 + a_1*age + a_2*Elo + a_3*age*Elo + a_4*age^2 + a_5*Elo^2 + b_1*player*minutes_{t-1} + b_2*player*Elo_{t-1} + b_3*player*minutes_{t-1}*Elo_{t-1} + \ldots$
Below shows a model with lagged terms for the previous two seasons, which does help to personalise the predictions somewhat (in purple; model without lagged terms in blue).
However, this creates a jagged shift in predictions in the short-term (i.e. between the 2nd and 3rd season going forward), and worsens some predictions in the long-term (e.g. at age 35, player_id=2 is predicted to play more minutes at Elo 90 than at Elo 60). Furthermore, expanding this approach by including more lagged terms (e.g. for the past five seasons) will lead to a very large number of model coefficients which seems not ideal?
Other options
Other regression possibilities could include (i) non-linear mixed effects models (NLMMs) with the same fixed effects as the nonlinear least squares above but with player_id additionally modelled as a random effect; (ii) time series forecasting models (e.g. ARIMA) which somehow account for correlations between each time series; (iii) recurrent neural networks (e.g. LSTM) which input all previous predictions (i.e. not just the last N seasons as a lagged variable). However, all of the regression-based approaches seem to me less capable of learning player similarity information both within and between players.