资源简介
matlab开发-kmvcreditriskmodel违约风险概率。根据穆迪的KMV计算违约概率。公司股票遵循欧洲认购期权
代码片段和文件信息
function [N1TVSG]=KMV_MODEL(SEQFrTENDN)
%% Document title
% KMV-Merton model Probability of Default represented by Jin-Chuan Duan Genevi‘eve Gauthier and
% Jean-Guy Simonato (2005)
% This code calculates the probability of default based on Moody抯 KMV
% where firms equity follows European call option.
%% Author
% Author : Haidar Haidar University of Sussex Email: h.haidar@sussex.ac.uk
% Date: 3rd - April - 2010 homepage: http://www.maths.sussex.ac.uk/~hh56
%% Reference:
% 1) On the Equivalence of the KMV and Maximum Likelihood Methods for
% Structural Credit Risk Models by Jin-Chuan Duan Genevi‘eve Gauthier and
% Jean-Guy Simonato 2005
%% Inputs
% S : Vector of Share prices as a time series starts with times t=123.
% EQ : Number of outstanding shares
% F : Total Liabilities
% r : free interest rate
% TEND : Time horizontal in years
% N : Number of time steps
%% Accuracy
% NR_Acc : The accuracy of Newton Raphson method
% Sig_Acc : The accuracy of Sigma
%% Example
% [N1TSG]=KMV_MODEL(cumprod(((rand(1100)-0.55)/10)+1)10.90.05550)
%% OutPut
%
% N1 : The Expected Probability of Default
% TV : Time Horizontal for the correspoding probability of default
% SG : Asset Volatility
%% Code
%%%%%%%%%%%%
Sig_Acc=10^-7;
lm=length(S);
E=S*EQ;
% Scale the values
if E>1000
E=E/10000;
F=F/10000;
end
LS=log(S(2:end)./S(1:end-1));
h=length(E);
SGE=std(LS);
% SG : Asset Volatility to be computed here is given an initial value.
SG=SGE*(E(1)/(E(1)+F));
TV=TEND/N:TEND/N:TEND;
for jkk=1:N
% i=1;
% TM is the Asset Volatility at the previous iteration
% TM is initialized at the first step
TM=100;
while abs(SG-TM)>Sig_Acc
for j=1:lm
% V(j) is the asset value at time step j
V(j)=NRMethod(FFE(j)rTV(jkk)SG);
end
% LR is the implied asset returns ( Log returns )
LR=log(V(2:end)./V(1:end-1));
R=mean(LR);
TM=SG;
SG=std(LR)*sqrt(h);
% Mu is the expected return of the asset value
Mu =h*R+0.5*SG^2;
% i=i+1;
end
% SG % asset volatility
d1=-(log(V(lm)/F(1))+(Mu -(0.5*SG^2))*TV(jkk))/(SG*sqrt(TV(jkk)));
N1(jkk)=0.5*(1+erf(d1/sqrt(2)));
end
plot(TVN1‘b‘)
xlabel(‘Time Horizontal in Years‘)
ylabel(‘Expected Probability of Default‘)
return
% Date: 3rd - April - 2010
% Author : Haidar Haidar
% University of Sussex
% Email: h.haidar@sussex.ac.uk
% Newton Raphson method
function [S]=NRMethod(SEcrTsig)
NR_Acc=10^-7;
Tem=0;
k=1;
while abs(S-Tem)>NR_Acc
d1=(log(S/E)+(r+(0.5*sig^2))*T)/(sig*sqrt(T));
d2=d1-(sig*sqrt(T));
f=c-S*0.5.*(1+erf(d1/sqrt(2)))+exp(-r*(T))*E*0.5*(1+erf(d2/sqrt(2)));
df=-0.5.*(1+erf(d1/sqrt(2))); % the derivative
Tem=S;
S=Tem-f/df;
k=k+1;
end
return
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 9161 2012-06-23 02:09 KMV_MODEL.html
文件 2922 2012-06-23 02:09 KMV_MODEL.m
文件 2861 2011-12-10 04:45 PD.fig
文件 1313 2014-02-12 14:03 license.txt
相关资源
- matlab开发-IEEE754二进制表示
- matlab开发-17电平模块多电平转换器
- matlab开发-Xfoilformatlab
- matlab开发-脑瘤的分割
- matlab开发-车辆网络工具箱支持kvaser和
- matlab开发-CryoSat2DEMs
- matlab开发-BlandAltmanplot
- matlab开发-使用PSO的最佳模糊控制器
- matlab开发-电机磁轴承
- matlab开发-Treynorblackportfoliomanagement模型
- matlab开发-黑白图像增强器
- matlab开发-二维波动方程模拟
- matlab开发-ResponseSpectra
- matlab开发-huashiyiqikeLSTMMATLAB
- matlab开发-HestonOptionPricer
- matlab开发-三相电压调节器
- matlab开发-单级电液伺服阀
-
matlab开发-iau2006 acioba
sedDusingXy系列 - matlab开发-带DPWM0调制的三相逆变器
- matlab开发-Earthquakesimulation
- matlab开发-带MPPT的住宅网格连接PVSys
- matlab开发-pplot
评论
共有 条评论