Tâche. Il y a une calculatrice , mais pas de tableaux statistiques à portée de main . Par exemple, vous avez besoin de tableaux de points critiques de la distribution de Student pour calculer l' intervalle de confiance. Obtenir un ordinateur avec Excel? Pas athlétique.
Une grande précision n'est pas nécessaire, vous pouvez utiliser des formules approximatives. L'idée des formules ci-dessous est qu'en transformant l'argument, toutes les distributions peuvent être en quelque sorte réduites à la normale. Les approximations devraient fournir à la fois le calcul de la fonction de distribution cumulative et le calcul de sa fonction inverse.
Commençons par la distribution normale.
Il faut calculer la fonction et l'inverse. J'ai utilisé l'approximation [1]:
Où et - variables auxiliaires:
et la constante ... Voici le code en langue Octave.
function y = erfa(x)
a = 0.147;
x2 = x**2; t = x2*(4/pi + a*x2)/(1 + a*x2);
y = sign(x)*sqrt(1 - exp(-t));
endfunction
function y = erfinva(x)
a = 0.147;
t1 = 1 - x**2; t2 = 2/pi/a + log(t1)/2;
y = sign(x)*sqrt(-t2 + sqrt(t2**2 - log(t1)/a));
endfunction
function y = normcdfa(x)
y = 1/2*(1 + erfa(x/sqrt(2)));
endfunction
function y = norminva(x)
y = sqrt(2)*erfinva(2*x - 1);
endfunction
Maintenant, quand il y a des fonctions de distribution normales, nous donnons un argument et calculons la distribution t de Student [2]:
où variable auxiliaire il y a
function y = tcdfa(x,n)
t1 = (n - 1.5)/(n - 1)**2;
y = normcdfa(sqrt(1/t1*log(1 + x**2/n)));
endfunction
function y = tinva(x,n)
t1 = (n - 1.5)/(n - 1)**2;
y = sqrt(n*exp(t1*norminva(x)**2) - n);
endfunction
L'idée de calculer la distribution grossièrement est clairement représenté par des formules [3]:
function y = chi2cdfa(x,n)
s2 = 2/9/n; mu = 1 - s2;
y = normcdfa(((x/n)**(1/3) - mu)/sqrt(s2));
endfunction
function y = chi2inva(x,n)
s2 = 2/9/n; mu = 1 - s2;
y = n*(norminva(x)*sqrt(s2) + mu)**3;
endfunction
( ) . [4], , .
, .
function y = fcdfa(x,k,n)
mu = 1-2/9/k; s = sqrt(2/9/k);
lambda = (2*n + k*x/3 + k-2)/(2*n + 4*k*x/3);
normcdfa(((lambda*x)**(1/3)-mu)/s)
endfunction
function y = finva(x,k,n)
mu = 1-2/9/k; s = sqrt(2/9/k);
q = (norminva(x)*s + mu)**3;
b = 2*n + k-2 -4/3*k*q;
d = b**2 + 8/3*k*n*q;
y = (sqrt(d) - b)/(2*k/3);
endfunction
- Sergei Winitzki. A handy approximation for the error function and its inverse. February 6, 2008.
- Gleason J.R. A note on a proposed Student t approximation // Computational statistics & data analysis. – 2000. – Vol. 34. – №. 1. – Pp. 63-66.
- Wilson E.B., Hilferty M.M. The distribution of chi-square // Proceedings of the National Academy of Sciences. – 1931. – Vol. 17. – №. 12. – Pp. 684-688.
- Li B. and Martin E.B. An approximation to the F-distribution using the chi-square distribution. Computational statistics & data analysis. – 2002. Vol. 40. – №. 1. pp. 21-26.