# Matrix Forecasting - Ask for Methodology Suggestion

I'm just thinking in a problem and i would like suggestions to methodology (if some do this).

Let's think in a 3 person, and each one sells 1 service. So, thinking in the price of their services/payments we have this matrix (yes, they pay for themselves)

On this, in 1# month, P2 pays 0.8 to P1, but, P1 pays 0.2 to P2 (lines are payments to services in columns)

   1# Month                   2# Month                   3# Month

P1   P2   P3               P1   P2   P3               P1   P2   P3
P1  0.3  0.2  0.4          P1  0.4  0.4  0.5          P1  0.3  0.5  0.6
P2  0.8  0.4  0.3          P2  0.7  0.5  0.4          P2  0.6  0.4  0.4
P3  0.4  0.1  0.3          P3  0.3  0.3  0.2          P3  0.3  0.2  0.3


Is there any methodology that help forecast the 4# month matrix?

*R, stata and matlab hints are allowed

• Can you assume the fielsd in the matrices to be independent of each other and that there is only time-dependence? – Tim Oct 23 '17 at 14:05

## 2 Answers

The simple approach is to try vector autoregression (VAR). In this case you vectorize the matrix, e.g. instead of $P_{ij}$ where $i,j\in[1:3]$ you create a new matrix $p_k$, where $k=(i-1)*3+j$ so that $k\in[1:9]$. Then your VAR(1) model would be $$p_k(t)=\beta_{k}+ \sum_{l=1}^3\Phi_{kl} p_l(t-1)+\varepsilon_k(t),$$ where $\varepsilon(t)\sim\mathcal N(0,\Omega)$ and $\Omega_{kl}$ - coevariance matrix of errors of each element of the vector $p_k$ and $\beta,\Phi$ - are constant matrices.

Obviously, this works when the payment matrix is stationary. If it's not stationary you need to make it stationary using suitable methods such as differencing, log-dofferencing etc.

• Didn't know this approach. As real matrices are economic data, probably is not stationary. Must check. This is a great help. – Adilson V Casula Oct 24 '17 at 14:55
• But in this way, may i use some binary variable to set what column that new line refers? – Adilson V Casula Oct 24 '17 at 15:03
• The reason I suggested this approach is that you didn't specify any constraints on the rows and columns. In this regard your matrix doesn't have any properties that makes it different from 9 correlated numbers. Unless you specify those constraints you may try using anything that works in VAR or similar multivariate time series approaches. – Aksakal Oct 24 '17 at 15:05

First and maybe simple thing that comes to my mind is - you could think of the payments from person $i$ to person $j$ as time series and try to forecast the next month. You could try a simple linear model regressing payment on month, or you could try for example models from the forecast package in R.
So for instance you could try an ARIMA model where the previous payments from person $i$ to person $j$ are used as predictors but you could also try dynamic regression / regression with ARIMA errors where (if it makes sense of course) you could include "reverse" payments from person $j$ to person $i$ as additional predictors as well. hth.

• I think the time series (by vector) is not possible in this case. I didn't tell, for not make things difficult in main problem. But assuming that 1 works to 3, he can't works 2. The numbers can receive influences by other sellers, so your second option can makes sense here. dyn.reg maybe can do the job. Thanks – Adilson V Casula Oct 24 '17 at 14:50