# Forecasting or solving system of linear equations

I am looking for advice on the best approach for solving a system of equations with imperfect and incomplete data, such that standard approaches including: Guassian elimination, Gauss-Jordan elimination or Montante's method for solving a system of linear equations will not work.

The data set is a series of binary variables and the goal is to determine an approximation of the value it inputs to the system. What would be the best way to estimate the value for each variable?

Example Data:

A   B   C   D   E   F   G   H   I   J   K   L   TOT
0   1   0   1   1   0   0   1   1   0   1   1   70
0   1   0   1   1   0   0   1   1   0   1   0   69
0   1   0   1   1   0   0   1   1   0   0   0   68
0   1   0   1   0   1   0   1   1   0   1   0   66
0   1   0   1   1   0   0   1   0   1   1   0   65
0   1   0   1   1   0   1   0   1   0   0   0   63
0   1   0   1   1   0   0   1   0   1   0   0   63
0   1   0   1   0   1   0   1   0   1   1   0   62
0   1   1   0   1   0   0   1   1   0   1   0   61
0   1   1   0   1   0   0   1   1   0   1   0   61
0   1   1   0   1   0   1   0   1   0   1   0   57
1   0   0   1   1   0   1   0   1   0   0   0   52
1   0   1   0   0   1   0   1   0   1   1   1   44
1   0   1   0   1   0   1   0   0   1   0   0   40

• So are columns A through L supposed to predict TOT? I don't see any missing information here. – Demetri Pananos Feb 12 at 5:53
• please provide more information, e.g. what is TOT? I assume you have TOT and want to approximate values of variables A to L, if there is a missing? – JAbr Feb 12 at 6:03
• Hello @DemetriPananos and JAbr. TOT is the total value that is computed when the variables A-L are "on/off". I tried using linear regression in R but I'm not sure if that is the best approach. Naturally some variables will not be able to be calculate as there is insufficient number of samples. – JennaS Feb 12 at 21:16
• How many complete examples (without missing data) do you have? You are showing 14 here. Since 14>12, your system is possibly over-determined, so you are looking not for an exact solution but one that minimizes some loss function, like sum squared error. So we're regressing, not solving, right? – Peter Leopold Feb 15 at 5:18
• Hello Peter - thank you! I'm new to stats so I didn't know of the concept of over-determined. Yes I'm not looking for an exact solution but one that is a close approximate such that given the approximate I could find out the best combination of A-L that would maximize the cost function (or TOT) – JennaS Feb 15 at 6:37

For this example I used linear regression within R to solve the variables A-L.

Specifically:

Data <- read.csv("matrix.csv")
sink("summary.csv")
lm(TOT ~ . + 0, Data)
sink()


If, for example, the matrix was representing a series of linear equations with the coefficients being integers between 0 and 9 would the same approach still be possible to determine the values of A-L?

Thank you!