comparison scripts/statistics/base/kurtosis.m @ 7411:83a8781b529d

[project @ 2008-01-22 21:52:25 by jwe]
author jwe
date Tue, 22 Jan 2008 21:52:26 +0000
parents a1dbe9d80eee
children 81d6ab3ac93c
comparison
equal deleted inserted replaced
7410:8a3b2ccc4e11 7411:83a8781b529d
85 x = sum(x.^4, dim); 85 x = sum(x.^4, dim);
86 ind = find (s > 0); 86 ind = find (s > 0);
87 retval(ind) = x(ind) ./ (c * s(ind) .^ 4) - 3; 87 retval(ind) = x(ind) ./ (c * s(ind) .^ 4) - 3;
88 88
89 endfunction 89 endfunction
90
91 %!test
92 %! x = [-1; 0; 0; 0; 1];
93 %! y = [x, 2*x];
94 %! assert(all (abs (kurtosis (y) - [-1.4, -1.4]) < sqrt (eps)));
95
96 %!error kurtosis ();
97
98 %!error kurtosis (1, 2, 3);
99