The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



CalcHatMatrix


Unit: SDL_matrix
Class: TMatrix
Declaration: function CalcHatMatrix (var HatMat: TMatrix): boolean;

The function CalcHatMatrix calculates the hat matrix and stores the result in matrix HatMat:

HatMat := X(XTX)-1XT

The function returns a TRUE value if the hat matrix has been calculated correctly. The reasons for a returned FALSE value might be one of the following:
  • not enough memory on heap
  • the inversion of the scatter matrix XTX was not possible (singular covariance matrix)

 

Hint: Please note that the calculation of the hat matrix can consume considerable amounts of memory. The memory requirement (including the original matrix and HatMat) amounts to 8*((p+n)2 + pn) bytes, with p being the number of columns of the data matrix and n being the number of rows.



Last Update: 2018-Dec-21