defprobcurve
Можно использовать defprobcurve
или defprobstrip
создать defprobcurve
объект.
% defprobcurve
Settle = datetime(2019,9,20);
DefProbTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])];
DefaultProbabilities = [0.005 0.007 0.01 0.015 0.026 0.04 0.077 0.093 0.15 0.20]';
ProbDates = Settle + DefProbTimes;
DefaultProbCurve = defprobcurve(Settle,ProbDates,DefaultProbabilities)
DefaultProbCurve = defprobcurve with properties: Settle: 20-Sep-2019 Basis: 2 Dates: [10×1 datetime] DefaultProbabilities: [10×1 double]
Можно затем использовать defprobcurve
объект с survprobs
hazardrates
.
% hazardrates
hazardrates(DefaultProbCurve)
ans = 0.0099 0.0039 0.0030 0.0050 0.0111 0.0142 0.0194 0.0057 0.0064 0.0060
% survprobs
Settle = datetime(2019,9,20);
SurvProbTimes = [calmonths([6 12 18])];
SurvProbDates = Settle + SurvProbTimes;
outSurvProb = survprobs(DefaultProbCurve, SurvProbDates)
outSurvProb = 0.9950 0.9930 0.9915
fininstrument
| finmodel
| finpricer