comparison m-toolbox/classes/+utils/@math/Norminv.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 inverse of the Normal cumulative distribution function
4 %
5 % CALL
6 %
7 % x = Norminv(p,mu,sigma);
8 %
9 %
10 % INPUT
11 %
12 % - p, probability
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: Norminv.m,v 1.1 2011/02/14 16:08:25 luigi Exp $
24 %
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26 function x = Norminv(p,mu,sigma)
27
28 xt = -sqrt(2).*erfcinv(2*p);
29 x = sigma.*xt + mu;
30
31 end