Double MBoxTest(TMtx X1, TMtx X2, ref Double Signif, ref THypothesisResult hRes, ref Int32 df1, ref Int32 df2, Double Alpha)
M-Box test for equal covariances.
| # | Name | Description |
|---|---|---|
| 1 | X1 | First matrix. The number of columns for X1 and X2 must be equal, otherwise an exception is raised. |
| 2 | X2 | Second matrix. The number of columns for X1 and X2 must be equal, otherwise an exception is raised. |
| 3 | df1 | Nominator degrees of freedom. |
| 4 | df2 | Denominator degrees of freedom. |
| 5 | Alpha | Defines the desired significance level. |
| 6 | hRes | Returns the result of the null hypothesis. |
| 7 | Signif | (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
using Dew.Math;
using Dew.Stats.Units;
using Dew.Stats;
namespace Dew.Examples
{
private void Example()
{
int df1, df2;
Matrix X1 = new Matrix(0, 0);
Matrix X2 = new Matrix(0, 0);
X1.SetIt(5, 3, false, new double[] { 23, 45, 15, 40, 85, 18, 215, 307, 60, 110, 110, 50, 65, 105, 24 });
X2.SetIt(5, 3, false, new double[] { 277, 230, 63, 153, 80, 29, 306, 440, 105, 252, 350, 175, 143, 205, 42 });
THypothesisResult hres;
double sign;
double MB = Statistics.MBoxTest(X1, X2, out sign, out hres, out df1, out df2, 0.05);
// MB : 27,16221062
// Sign : 0,01619810
// Sign < Alpha meaning hres = hrReject i.e. covariance matrices are significantly different.
}
}
See Also: Statistics.HotellingT2One