# LeastSquares with some parameters missing

I want to do a partial least squares (PLS) regression using LeastSquares on my data.

The input parameters are temperature, humidity and pressure for a given date. The problem is that some parameters are missing, for example on 6. 9. 2013 the temperature and pressure were recorded, but humidity was not.

m = {
...
{{2013,9,5},30.0,65.,101.45},
{{2013,9,6},28.6,,101.41},
{{2013,9,7},29.3,58.,101.29},
...
}


Is it possible to use the available data for days like that, or do I have to leave those days out?

-
show how you do it with a complete data set. – george2079 Oct 10 '13 at 18:28
@george2079 The LeastSquares function takes a m×n matrix of input parameters and a list of n output parameters and after doing a regression returns a list of m coefficients. In my case the input parameters are the temperature, humidity and pressure, and the output parameters are the temperatures for the next day. If I use only days with all data recorded it works. – shrx Oct 10 '13 at 18:52
Perhaps the simplest solution is to replace the missing values. A reasonable candidate would be the mean of the missing parameter(s) (so that your data insertion doesn't change the mean of the data). – bill s Oct 10 '13 at 22:54
There is a complete tutorial on "missing data" that may be of help. reference.wolfram.com/mathematica/howto/… – bill s Oct 11 '13 at 0:22
i know what it does, put up some code so people wanting to help don't need to reinvent the wheel. – george2079 Oct 11 '13 at 12:46