资源简介
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开发-能带计算
- matlab开发-FlockingAlgorithm
- matlab开发-MuellerStokesJonesCalculus
- matlab开发-HX711的自定义数据库
- matlab开发-SMOTEBoost
- matlab开发-果蝇优化算法第二版
- matlab开发-多变量决策树
- matlab开发-水轮发电机模型
- matlab开发-交通警告标志识别标签代码
- matlab开发-RUSBoost
- matlab开发-基于遗传算法的机器人运动
- matlab开发-MPU6050加速度陀螺仪
- matlab开发-功率曲线FAsmallscalewindturbi
- matlab开发-NASAJPLDE405开发星历表
- matlab开发-SortinoRatio
- matlab开发-永磁TDC并联电机数学模型
- matlab开发-3相SPWM整流器
- matlab开发-Kilobotswarm控制Matlabarduino
- matlab开发-简单音频播放
- matlab开发-记录文件的绘图仪加速度、
- matlab开发-永磁同步电机PMSM动态数学模
- matlab开发-多目标优化差分进化算法
- matlab开发-随机微分方程解算
- matlab开发-波长调制光谱的二次谐波模
- matlab开发-仿制药生物生理学基础药动
- matlab开发-使用svmrfe选择功能
- matlab开发-KDTreeNearestNeighborandRangeSear
- matlab开发-stlread
- matlab开发-三维图像堆栈查看器
- matlab开发-动态电压恢复器故障dvr
评论
共有 条评论