Main Content

hazardrates

Compute hazard rates based on default probability curve

Since R2020a

Description

example

OutRates = hazardrates(obj) computes hazard rates based on a defprobcurve object.

Examples

collapse all

Create a defprobcurve object using defprobcurve and then use hazardrates to calculate the hazard rates.

Settle = datetime(2017,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,'Basis',5)
DefaultProbCurve = 
  defprobcurve with properties:

                  Settle: 20-Sep-2017
                   Basis: 5
                   Dates: [10x1 datetime]
    DefaultProbabilities: [10x1 double]

hazardrates(DefaultProbCurve)
ans = 10×1

    0.0100
    0.0040
    0.0030
    0.0051
    0.0112
    0.0145
    0.0197
    0.0058
    0.0065
    0.0061

Input Arguments

collapse all

defprobcurve object, specified as a previously created defprobcurve object.

Data Types: object

Output Arguments

collapse all

Hazard rates, returned as a numeric.

Version History

Introduced in R2020a