summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/dvips
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-09-30 22:53:50 +0000
committerKarl Berry <karl@freefriends.org>2010-09-30 22:53:50 +0000
commit70f4dde5113ebf40e4ea4009f40cb2b77a5598a8 (patch)
treeb525b8e681f3bfce9772e0aed680de67e13cf382 /Master/texmf-dist/dvips
parentc10f8829c217b6699fdd00dae7735deeece7a560 (diff)
pst-math (30sep10)
git-svn-id: svn://tug.org/texlive/trunk@19962 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips')
-rw-r--r--Master/texmf-dist/dvips/pst-math/pst-math.pro46
1 files changed, 44 insertions, 2 deletions
diff --git a/Master/texmf-dist/dvips/pst-math/pst-math.pro b/Master/texmf-dist/dvips/pst-math/pst-math.pro
index e2570773379..ae1b1db1436 100644
--- a/Master/texmf-dist/dvips/pst-math/pst-math.pro
+++ b/Master/texmf-dist/dvips/pst-math/pst-math.pro
@@ -4,8 +4,8 @@
% Author : Christophe JORSSEN
% Author : Herbert Voß <hvoss@tug.org>
% Created the : Sat 20 March 2004
-% Last Mod : $Date: 2009/08/27 $
-% Version : 0.5 $
+% Last Mod : $Date: 2010/09/29 $
+% Version : 0.6 $
%
/PI 3.14159265359 def
/ENeperian 2.71828182846 def
@@ -224,5 +224,47 @@ end
end
} def
%
+/c@_0 2.515517 def
+/c@_1 0.802853 def
+/c@_2 0.010328 def
+/d@_1 1.432788 def
+/d@_2 0.189269 def
+/d@_3 0.001308 def
+/norminv {
+ 5 dict begin
+ neg 1 add 1 exch div ln 2 mul sqrt
+ /t exch def
+ /t2 t dup mul def
+ /t3 t2 t mul def
+ c@_0 c@_1 t mul add c@_2 t2 mul add 1 d@_1 t mul add
+ d@_2 t2 mul add d@_3 t3 mul add div neg t add
+ end
+} def
+%end{norminv Michael Sharpe}
+%
+/vasicek{ %density=sqrt((1-R2)/R2)*exp(1/2*(norminv(x)2 - (1/sqrt(R2)*((sqrt(1-R2)*norminv(x)-norminv(pd)))2))
+ 2 dict begin
+ /pd 0.22 def % (0,1) probability of default of portfolio
+ /R2 0.11 def % (0,1) R_Squared of portfolio
+ dup % x x
+ norminv % x norminv(x)
+ dup mul % x norminv(x)^2
+ exch % norminv(x)2 x
+ norminv % norminv(x)2 norminv(x)
+ 1 R2 sub sqrt mul % norminv(x)2 sqrt(1-R2)*norminv(x)
+ pd norminv sub % norminv(x)2 sqrt(1-R2)*norminv(x)-norminv(pd)
+ R2 sqrt div % norminv(x)2 1/sqrt(R2)*(sqrt(1-R2)*norminv(x)-norminv(pd))
+ dup mul % norminv(x)2 (1/sqrt(R2)*(sqrt(1-R2)*norminv(x)-norminv(pd)))2
+ sub % norminv(x)2 -(1/sqrt(R2)*(sqrt(1-R2)*norminv(x)-norminv(pd)))2
+ 2 div % 1/2*(norminv(x)2 -(1/sqrt(R2)*(sqrt(1-R2)*norminv(x)-norminv(pd)))2)
+ ENeperian exch exp % exp(1/2*(norminv(x)2 -(1/sqrt(R2)*(sqrt(1-R2)*norminv(x)-norminv(pd)))2)
+ 1 R2 sub % exp(1/2*(norminv(x)2 -(1/sqrt(R2)*(sqrt(1-R2)*norminv(x)-norminv(pd)))2) 1-R2
+ R2 div % exp(1/2*(norminv(x)2 -(1/sqrt(R2)*(sqrt(1-R2)*norminv(x)-norminv(pd)))2) (1-R2)/R2
+ sqrt % exp(1/2*(norminv(x)2 -(1/sqrt(R2)*(sqrt(1-R2)*norminv(x)-norminv(pd)))2) sqrt((1-R2)/R2)
+ mul % sqrt((1-R2)/R2)*exp(1/2*(norminv(x)2 - (1/sqrt(R2)*((sqrt(1-R2)*norminv(x)-norminv(pd)))2))
+ end
+} def
+%end{vasicek density}
+%
%
% END pst-math.pro