comparison m-toolbox/classes/+utils/@math/SKcriticalvalues.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %
3 % Compute critical values of the Smirnov - Kolmogorov distribution
4 %
5 % CALL
6 %
7 % [F,X] = SKcriticalvalues(Y);
8 %
9 %
10 % INPUT
11 %
12 % - Y, a data series
13 %
14 % References:
15 % [1] Leslie H. Miller, Table of Percentage Points of Kolmogorov
16 % Statistics, Journal of the American Statistical Association,
17 % Vol. 51, No. 273 (Mar., 1956), pp. 111-121
18 %
19 %
20 % L Ferraioli 06-12-2010
21 %
22 % $Id: SKcriticalvalues.m,v 1.4 2011/03/31 15:38:18 luigi Exp $
23 %
24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25 function cVal = SKcriticalvalues(n1,n2,alph)
26
27 if isempty(n2)
28 n = n1; % test against theoretical distribution
29 else
30 n = n1*n2/(n1+n2); % test of two empirical distributions
31 end
32 A = 0.09037*(-log10(alph)).^1.5 + 0.01515*log10(alph).^2 - 0.08467*alph - 0.11143;
33 asympt = sqrt(-0.5*log(alph)./n); % Smirnov asymptothic formula
34 cVal = asympt - 0.16693./n - A./n.^1.5;
35 end
36