public class BondCurve extends AbstractCurve
Curve.
The bond curve is built as a product of a given reference discount curve and spread curve.
Since it is not clear in general if the reference curve or the spread curve are given in terms of
discount factors or zero rates, this class distinguishes between all possible cases of types.
For the curve types provided see BondCurve.Type.| Modifier and Type | Class and Description |
|---|---|
static class |
BondCurve.Type
Possible curve types, where the first term stands for the reference discount curve and the
second term stands for the spread curve.
|
| Constructor and Description |
|---|
BondCurve(String name,
LocalDate referenceDate,
Curve referenceCurve,
Curve spreadCurve,
BondCurve.Type type)
Creates a bond curve.
|
| Modifier and Type | Method and Description |
|---|---|
CurveBuilder |
getCloneBuilder()
Returns a curve builder bases on a clone of this curve.
|
double |
getDiscountFactor(AnalyticModel model,
double time) |
double |
getDiscountFactor(double time) |
String |
getName()
Get the name of the curve.
|
double[] |
getParameter()
Get the current parameter associated with the state of the objects.
|
Curve |
getReferenceCurve() |
LocalDate |
getReferenceDate()
Return the reference date of this curve, i.e. the date
associated with t=0.
|
Curve |
getSpreadCurve() |
String |
getType() |
double |
getValue(AnalyticModel 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.
|
double |
getValue(double time)
Returns the value for the time using the interpolation method associated with this curve.
|
double |
getZeroRate(double maturity)
Returns the zero rate for a given maturity, i.e., -ln(df(T)) / T where T is the given maturity and df(T) is
the discount factor at time $T$.
|
void |
setParameter(double[] parameter)
Set the current parameter and change the state of the objects.
|
clone, getCloneForParameter, getValues, toStringpublic BondCurve(String name, LocalDate referenceDate, Curve referenceCurve, Curve spreadCurve, BondCurve.Type type)
name - Name of the curve.referenceDate - The reference date for this curve, i.e., the date which defined t=0.referenceCurve - The reference discount curve.spreadCurve - The given spread curve.type - The types of the given curves "referenceCurve" and "spreadCurve" (discount factor or zero rate)public double getValue(double time)
CurvegetValue in interface CurvegetValue in class AbstractCurvetime - Time for which the value should be returned.public double getValue(AnalyticModel model, double time)
Curvemodel - An analytic model providing a context.time - Time for which the value should be returned.public double getDiscountFactor(double time)
public double getDiscountFactor(AnalyticModel model, double time)
public double getZeroRate(double maturity)
maturity - The given maturity.public CurveBuilder getCloneBuilder() throws CloneNotSupportedException
CurveCloneNotSupportedException - Thrown, when this curve could not be cloned.public String getName()
CurvegetName in interface CurvegetName in class AbstractCurvepublic LocalDate getReferenceDate()
CurvegetReferenceDate in interface CurvegetReferenceDate in class AbstractCurvepublic Curve getReferenceCurve()
public Curve getSpreadCurve()
public String getType()
public double[] getParameter()
ParameterObjectpublic void setParameter(double[] parameter)
ParameterObjectparameter - The parameter associated with the new state of the objects.Copyright © 2019. All rights reserved.