DocumentationHelp Center
Compute survival probability based on default probability curve
outSurvProbs = survprobs(obj,inDates)
example
outSurvProbs = survprobs(obj,inDates) computes the survival probability based on the default probability curve object.
outSurvProbs
obj
inDates
collapse all
Create a defprobcurve object using defprobcurve and then use survprobs to calculate the survival probability.
defprobcurve
survprobs
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]'; DefProbDates = Settle + DefProbTimes; DefaultProbCurve = defprobcurve(Settle,DefProbDates,DefaultProbabilities,'Basis',5)
DefaultProbCurve = defprobcurve with properties: Settle: 20-Sep-2017 Basis: 5 Dates: [10x1 datetime] DefaultProbabilities: [10x1 double]
SurvProbTimes = [calmonths([6 12 18])]; SurvProbDates = Settle + SurvProbTimes; outSurvProb = survprobs(DefaultProbCurve, SurvProbDates)
outSurvProb = 3×1 0.9950 0.9930 0.9915
defprobcurve object, specified as a previously created defprobcurve object.
Data Types: object
object
Survival probability dates, specified as a scalar datetime, serial date number, date character vector, or date string.
Data Types: double | char | string | datetime
double
char
string
datetime
Survival probability, returned as a numeric.
defprobstrip | hazardrates
defprobstrip
hazardrates
A modified version of this example exists on your system. Do you want to open this version instead?
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office