diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/+utils/@math/Norminv.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,31 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Compute inverse of the Normal cumulative distribution function
+% 
+% CALL 
+% 
+% x = Norminv(p,mu,sigma);
+% 
+% 
+% INPUT
+% 
+% - p, probability
+% - mu, distribution mean
+% - sigma, distribution standard deviation
+% 
+%   References:
+%      [1]  M. Abramowitz and I. A. Stegun, "Handbook of Mathematical
+%      Functions", Government Printing Office, 1964, 26.2.
+% 
+%
+% L Ferraioli 14-02-2011
+%
+% $Id: Norminv.m,v 1.1 2011/02/14 16:08:25 luigi Exp $
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function x = Norminv(p,mu,sigma)
+
+ xt = -sqrt(2).*erfcinv(2*p);
+ x = sigma.*xt + mu;
+
+end