public class HazardCurve extends Curve implements Serializable, HazardCurveInterface
Curve.CurveBuilder, Curve.ExtrapolationMethod, Curve.InterpolationEntity, Curve.InterpolationMethod| Modifier and Type | Method and Description |
|---|---|
protected void |
addSurvivalProbability(double maturity,
double survivalProbability,
boolean isParameter) |
static HazardCurve |
createHazardCurveFromHazardRate(String name,
Date referenceDate,
double[] times,
double[] givenHazardRates,
boolean[] isParameter,
Curve.InterpolationMethod interpolationMethod,
Curve.ExtrapolationMethod extrapolationMethod,
Curve.InterpolationEntity interpolationEntity)
Create a hazard curve from given times and given zero rates using given interpolation and extrapolation methods.
|
static HazardCurve |
createHazardCurveFromHazardRate(String name,
double[] times,
double[] givenHazardRates)
Create a discount curve from given times and given zero rates using default interpolation and extrapolation methods.
|
static HazardCurve |
createHazardCurveFromHazardRate(String name,
org.threeten.bp.LocalDate referenceDate,
double[] times,
double[] givenHazardRates,
boolean[] isParameter,
Curve.InterpolationMethod interpolationMethod,
Curve.ExtrapolationMethod extrapolationMethod,
Curve.InterpolationEntity interpolationEntity)
Create a hazard curve from given times and given hazard rates using given interpolation and extrapolation methods.
|
static HazardCurve |
createHazardCurveFromHazardRate(String name,
org.threeten.bp.LocalDate referenceDate,
double[] times,
double[] givenHazardRates,
Curve.InterpolationMethod interpolationMethod,
Curve.ExtrapolationMethod extrapolationMethod,
Curve.InterpolationEntity interpolationEntity)
Create a discount curve from given times and given zero rates using given interpolation and extrapolation methods.
|
static HazardCurve |
createHazardCurveFromSurvivalProbabilities(String name,
double[] times,
double[] givenSurvivalProbabilities)
Create a hazard curve from given times and given discount factors using default interpolation and extrapolation methods.
|
static HazardCurve |
createHazardCurveFromSurvivalProbabilities(String name,
double[] times,
double[] givenSurvivalProbabilities,
boolean[] isParameter,
Curve.InterpolationMethod interpolationMethod,
Curve.ExtrapolationMethod extrapolationMethod,
Curve.InterpolationEntity interpolationEntity)
Create a hazard curve from given times and given survival probabilities using given interpolation and extrapolation methods.
|
static HazardCurve |
createHazardCurveFromSurvivalProbabilities(String name,
double[] times,
double[] givenSurvivalProbabilities,
Curve.InterpolationMethod interpolationMethod,
Curve.ExtrapolationMethod extrapolationMethod,
Curve.InterpolationEntity interpolationEntity)
Create a hazard curve from given times and given survival probabilities using given interpolation and extrapolation methods.
|
static HazardCurve |
createHazardCurveFromSurvivalProbabilities(String name,
org.threeten.bp.LocalDate referenceDate,
double[] times,
double[] givenSurvivalProbabilities,
boolean[] isParameter,
Curve.InterpolationMethod interpolationMethod,
Curve.ExtrapolationMethod extrapolationMethod,
Curve.InterpolationEntity interpolationEntity)
Create a hazard curve from given times and given survival probabilities using given interpolation and extrapolation methods.
|
double |
getHazardRate(AnalyticModelInterface model,
double maturity) |
double |
getSurvivalProbability(AnalyticModelInterface model,
double maturity)
Return the survival probability for a given maturity.
|
double |
getValue(AnalyticModelInterface model,
double time)
Returns the value for the time using the interpolation method associated with this curve
within a given context, i.e., a model.
|
String |
toString() |
addPoint, clone, getCloneBuilder, getCloneForParameter, getExtrapolationMethod, getInterpolationEntity, getInterpolationMethod, getParameter, getParameterIndex, getTimeIndex, getValue, setParametergetName, getReferenceDate, getValuesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclone, getCloneBuilder, getCloneForParameter, getName, getReferenceDate, getValuegetParameter, setParameterpublic static HazardCurve createHazardCurveFromSurvivalProbabilities(String name, org.threeten.bp.LocalDate referenceDate, double[] times, double[] givenSurvivalProbabilities, boolean[] isParameter, Curve.InterpolationMethod interpolationMethod, Curve.ExtrapolationMethod extrapolationMethod, Curve.InterpolationEntity interpolationEntity)
name - The name of this hazard curve.referenceDate - The reference date for this curve, i.e., the date which defined t=0.times - Array of times as doubles.givenSurvivalProbabilities - Array of corresponding survival probabilities.isParameter - Array of booleans specifying whether this point is served "as as parameter", e.g., whether it is calibrates (e.g. using CalibratedCurves).interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.public static HazardCurve createHazardCurveFromSurvivalProbabilities(String name, double[] times, double[] givenSurvivalProbabilities, boolean[] isParameter, Curve.InterpolationMethod interpolationMethod, Curve.ExtrapolationMethod extrapolationMethod, Curve.InterpolationEntity interpolationEntity)
name - The name of this hazard curve.times - Array of times as doubles.givenSurvivalProbabilities - Array of corresponding survival probabilities.isParameter - Array of booleans specifying whether this point is served "as as parameter", e.g., whether it is calibrates (e.g. using CalibratedCurves).interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.public static HazardCurve createHazardCurveFromSurvivalProbabilities(String name, double[] times, double[] givenSurvivalProbabilities, Curve.InterpolationMethod interpolationMethod, Curve.ExtrapolationMethod extrapolationMethod, Curve.InterpolationEntity interpolationEntity)
name - The name of this hazard curve.times - Array of times as doubles.givenSurvivalProbabilities - Array of corresponding survival probabilities.interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.public static HazardCurve createHazardCurveFromSurvivalProbabilities(String name, double[] times, double[] givenSurvivalProbabilities)
name - The name of this hazard curve.times - Array of times as doubles.givenSurvivalProbabilities - Array of corresponding survival probabilities.public static HazardCurve createHazardCurveFromHazardRate(String name, org.threeten.bp.LocalDate referenceDate, double[] times, double[] givenHazardRates, boolean[] isParameter, Curve.InterpolationMethod interpolationMethod, Curve.ExtrapolationMethod extrapolationMethod, Curve.InterpolationEntity interpolationEntity)
givenSurvivalProbabilities[timeIndex] = givenSurvivalProbabilities[timeIndex-1] * Math.exp(- givenHazardRates[timeIndex] * (times[timeIndex]-times[timeIndex-1]));
name - The name of this hazard curve.referenceDate - The reference date for this curve, i.e., the date which defined t=0.times - Array of times as doubles.givenHazardRates - Array of corresponding hazard rates.isParameter - Array of booleans specifying whether this point is served "as as parameter", e.g., whether it is calibrates (e.g. using CalibratedCurves).interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.public static HazardCurve createHazardCurveFromHazardRate(String name, Date referenceDate, double[] times, double[] givenHazardRates, boolean[] isParameter, Curve.InterpolationMethod interpolationMethod, Curve.ExtrapolationMethod extrapolationMethod, Curve.InterpolationEntity interpolationEntity)
givenSurvivalProbabilities[timeIndex] = givenSurvivalProbabilities[timeIndex-1] * Math.exp(- givenHazardRates[timeIndex] * (times[timeIndex]-times[timeIndex-1]));
name - The name of this discount curve.referenceDate - The reference date for this curve, i.e., the date which defined t=0.times - Array of times as doubles.givenHazardRates - Array of corresponding survival probabilities.isParameter - Array of booleans specifying whether this point is served "as as parameter", e.g., whether it is calibrates (e.g. using CalibratedCurves).interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.public static HazardCurve createHazardCurveFromHazardRate(String name, org.threeten.bp.LocalDate referenceDate, double[] times, double[] givenHazardRates, Curve.InterpolationMethod interpolationMethod, Curve.ExtrapolationMethod extrapolationMethod, Curve.InterpolationEntity interpolationEntity)
givenSurvivalProbabilities[timeIndex] = givenSurvivalProbabilities[timeIndex-1] * Math.exp(- givenHazardRates[timeIndex] * (times[timeIndex]-times[timeIndex-1]));
name - The name of this discount curve.referenceDate - The reference date for this curve, i.e., the date which defined t=0.times - Array of times as doubles.givenHazardRates - Array of corresponding zero rates.interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.public static HazardCurve createHazardCurveFromHazardRate(String name, double[] times, double[] givenHazardRates)
givenSurvivalProbabilities[timeIndex] = givenSurvivalProbabilities[timeIndex-1] * Math.exp(- givenHazardRates[timeIndex] * (times[timeIndex]-times[timeIndex-1]));
name - The name of this discount curve.times - Array of times as doubles.givenHazardRates - Array of corresponding zero rates.public double getSurvivalProbability(AnalyticModelInterface model, double maturity)
HazardCurveInterfacegetSurvivalProbability in interface HazardCurveInterfacemodel - The analytic model, providing the context (e.g. in case where this curve is mapping to another curve "by name").maturity - The maturity \( T \).public double getHazardRate(AnalyticModelInterface model, double maturity)
protected void addSurvivalProbability(double maturity,
double survivalProbability,
boolean isParameter)
public double getValue(AnalyticModelInterface model, double time)
CurveInterfacegetValue in interface CurveInterfacegetValue in class Curvemodel - An analytic model providing a context.time - Time for which the value should be returned.Copyright © 2017. All rights reserved.