public final class AddFixedCurve extends Object implements Curve, org.joda.beans.ImmutableBean, Serializable
The spread curve is the primary curve, providing the metadata, parameters, sensitivity and perturbation.
The fixed curve only affects the shape of the curve via the yValue(double)
and firstDerivative(double) methods. The fixed curve is not exposed in the parameters.
| Modifier and Type | Class and Description |
|---|---|
static class |
AddFixedCurve.Meta
The meta-bean for
AddFixedCurve. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
double |
firstDerivative(double x)
Computes the first derivative of the curve.
|
Curve |
getFixedCurve()
Gets the fixed curve.
|
CurveMetadata |
getMetadata()
Gets the curve metadata.
|
double |
getParameter(int parameterIndex)
Gets the value of the parameter at the specified index.
|
int |
getParameterCount()
Gets the number of parameters.
|
ParameterMetadata |
getParameterMetadata(int parameterIndex)
Gets the metadata of the parameter at the specified index.
|
Curve |
getSpreadCurve()
Gets the spread curve.
|
int |
hashCode() |
static AddFixedCurve.Meta |
meta()
The meta-bean for
AddFixedCurve. |
AddFixedCurve.Meta |
metaBean() |
static AddFixedCurve |
of(Curve fixedCurve,
Curve spreadCurve)
Creates a curve as the sum of a fixed curve and a spread curve.
|
ImmutableList<Curve> |
split()
Obtains a list of underlying curves.
|
String |
toString() |
AddFixedCurve |
withMetadata(CurveMetadata metadata)
Returns a new curve with the specified metadata.
|
AddFixedCurve |
withParameter(int parameterIndex,
double newValue)
Returns a copy of the data with the value at the specified index altered.
|
AddFixedCurve |
withPerturbation(ParameterPerturbation perturbation)
Returns a perturbed copy of the data.
|
AddFixedCurve |
withUnderlyingCurve(int curveIndex,
Curve curve)
Replaces an underlying curve by a new curve.
|
double |
yValue(double x)
Computes the y-value for the specified x-value.
|
UnitParameterSensitivity |
yValueParameterSensitivity(double x)
Computes the sensitivity of the y-value with respect to the curve parameters.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcreateParameterSensitivity, createParameterSensitivity, findParameterIndex, getNamepublic static AddFixedCurve of(Curve fixedCurve, Curve spreadCurve)
fixedCurve - the fixed curvespreadCurve - the spread curvepublic CurveMetadata getMetadata()
CurveThis method returns metadata about the curve and the curve parameters.
For example, a curve may be defined based on financial instruments.
The parameters might represent 1 day, 1 week, 1 month, 3 months, 6 months and 12 months.
The metadata could be used to describe each parameter in terms of a Period.
The metadata includes an optional list of parameter metadata. If parameter metadata is present, the size of the list will match the number of parameters of this curve.
getMetadata in interface Curvepublic AddFixedCurve withMetadata(CurveMetadata metadata)
CurveThis allows the metadata of the curve to be changed while retaining all other information. If parameter metadata is present, the size of the list must match the number of parameters of this curve.
withMetadata in interface Curvemetadata - the new metadata for the curvepublic int getParameterCount()
ParameterizedDataThis returns the number of parameters, which can be used to create a loop to access the other methods on this interface.
getParameterCount in interface ParameterizedDatapublic double getParameter(int parameterIndex)
ParameterizedDatagetParameter in interface ParameterizedDataparameterIndex - the zero-based index of the parameter to getpublic ParameterMetadata getParameterMetadata(int parameterIndex)
ParameterizedDataIf there is no specific parameter metadata, an empty instance will be returned.
getParameterMetadata in interface CurvegetParameterMetadata in interface ParameterizedDataparameterIndex - the zero-based index of the parameter to getpublic AddFixedCurve withParameter(int parameterIndex, double newValue)
ParameterizedDataThis instance is immutable and unaffected by this method call.
withParameter in interface CurvewithParameter in interface ParameterizedDataparameterIndex - the zero-based index of the parameter to getnewValue - the new value for the specified parameterpublic AddFixedCurve withPerturbation(ParameterPerturbation perturbation)
ParameterizedDataThe perturbation instance will be invoked once for each parameter in this instance, returning the perturbed value for that parameter. The result of this method is a new instance that is based on those perturbed values.
This instance is immutable and unaffected by this method call.
withPerturbation in interface CurvewithPerturbation in interface ParameterizedDataperturbation - the perturbation to applypublic double yValue(double x)
Curvepublic UnitParameterSensitivity yValueParameterSensitivity(double x)
CurveThis returns an array with one element for each parameter of the curve. The array contains the sensitivity of the y-value at the specified x-value to each parameter.
yValueParameterSensitivity in interface Curvex - the x-value at which the parameter sensitivity is computedpublic double firstDerivative(double x)
Curve
The first derivative is dy/dx.
firstDerivative in interface Curvex - the x-value at which the derivative is takenpublic ImmutableList<Curve> split()
CurveIn most cases, the number of underlying curves is 1, thus a list of this curve is returned.
public AddFixedCurve withUnderlyingCurve(int curveIndex, Curve curve)
Curve
curveIndex must be coherent to the index of the list in split().
withUnderlyingCurve in interface CurvecurveIndex - the curve indexcurve - the new split curvepublic static AddFixedCurve.Meta meta()
AddFixedCurve.public AddFixedCurve.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic Curve getFixedCurve()
public Curve getSpreadCurve()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.