comparison m-toolbox/classes/+utils/@math/Normcdf.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 Normal cumulative distribution function
4 %
5 % CALL
6 %
7 % p = Normcdf(x,mu,sigma);
8 %
9 %
10 % INPUT
11 %
12 % - x, data
13 % - mu, distribution mean
14 % - sigma, distribution standard deviation
15 %
16 % References:
17 % [1] M. Abramowitz and I. A. Stegun, "Handbook of Mathematical
18 % Functions", Government Printing Office, 1964, 26.2.
19 %
20 %
21 % L Ferraioli 14-02-2011
22 %
23 % $Id: Normcdf.m,v 1.1 2011/02/14 16:08:25 luigi Exp $
24 %
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26 function p = Normcdf(x,mu,sigma)
27
28 z = (x-mu)./sigma;
29 p = 0.5*erfc(-z./sqrt(2));
30
31
32 end