Statistics.MBoxTest Method

function MBoxTest(const X1: TMtx; const X2: TMtx; out Signif: Double; out hRes: THypothesisResult; out df1: Integer; out df2: Integer; const Alpha: Double): Double;

M-Box test for equal covariances.

#NameDescription
1X1First matrix. The number of columns for X1 and X2 must be equal, otherwise an exception is raised.
2X2Second matrix. The number of columns for X1 and X2 must be equal, otherwise an exception is raised.
3df1Nominator degrees of freedom.
4df2Denominator degrees of freedom.
5AlphaDefines the desired significance level.
6hResReturns the result of the null hypothesis.
7Signif(Significance level) returns the probability of observing the given result

Returns: Double

Remarks:

Performs M-Box test for equal covariances. In this case the null hypothesis is that X1 and X2 covariances are equal and the alternative hypothesis is that X1 and X2 covariances are not equal.

Examples
Uses MtxExpr, Statistics, Math387;
procedure Example;
var X1,X2: Matrix;
MB,sign: double;
hres: THypothesisResult;
df1, df2: integer;
begin
    X1.SetIt(5,3,false,[23,45,15, 40,85,18, 215,307,60, 110,110,50, 65,105,24]);
    X2.SetIt(5,3,false,[277,230,63, 153,80,29, 306,440,105, 252,350,175, 143,205,42]);
    MB := MBoxTest(X1,X2,sign,hres, df1, df2, 0.05);
    // MB : 27,16221062
    // Sign : 0,01619810
    // Sign < Alpha meaning hres = hrReject i.e. covariance matrices are significantly different.
end;
See Also: Statistics.HotellingT2One