0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 function [lambda, T, F] = check_CovM(C_empir, C_theor, m, S)
0018
0019 p = size(C_empir, 1);
0020
0021 lambda = m * (log(det(C_theor) / det(C_empir)) - p + trace(C_empir * inv(C_theor)));
0022
0023 Tup = chi2inv(1 - (1 - S) / 2, 0.5 * p * (p + 1));
0024 Tlow = chi2inv((1 - S) / 2, 0.5 * p * (p + 1));
0025 T = [Tlow, Tup];
0026
0027 D1 = (2 * p + 1 - 2 / (p + 1)) / (6 * m);
0028 D2 = (p - 1) * (p + 2) / (6 * m ^ 2);
0029 q1 = p * (p + 1) / 2;
0030 q2 = (q1 + 2) / (D2 - D1 ^ 2);
0031 b = q1 / (1 - D1 - q1 / q2);
0032 q2 = min(10000, q2);
0033 Fup = b * finv(1 - (1 - S) / 2, q1, q2);
0034 Flow = b * finv((1 - S) / 2, q1, q2);
0035 F = [Flow, Fup];
0036
0037
0038