net.finmath.marketdata.model.curves
Class SeasonalCurve
- java.lang.Object
-
- net.finmath.marketdata.model.curves.AbstractCurve
-
- net.finmath.marketdata.model.curves.SeasonalCurve
-
- All Implemented Interfaces:
- java.lang.Cloneable, ParameterObjectInterface, CurveInterface
public class SeasonalCurve extends AbstractCurve implements CurveInterface
The curve returns a value depending on the month of the time argument, that is, a callgetValue(model, time)will map time to a 30/360 value using the day and month only and delegate the call to a given base curve. The value returned then isbaseCurve.getValue(model, season)whereseason = month / 12.0 + (day-1) / (double)numberOfDays / 12.0;The base curve has to be constructed according to this time convention (e.g., as a piecewise constant curve with values at i / 12 for i=1,...,12 usingCurve.InterpolationMethodwithPIECEWISE_CONSTANT_RIGHTPOINT.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classSeasonalCurve.CurveBuilderA builder (following the builder pattern) for SeasonalCurve objects.
-
Constructor Summary
Constructors Constructor and Description SeasonalCurve(java.lang.String name, java.util.Calendar referenceDate, CurveInterface baseCurve)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description SeasonalCurveclone()Create a deep copied clone.CurveBuilderInterfacegetCloneBuilder()Returns a curve builder bases on a clone of this curve.CurveInterfacegetCloneForParameter(double[] value)Create a clone with a modified parameter.double[]getParameter()Get the current parameter associated with the state of the objects.doublegetValue(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.voidsetParameter(double[] parameter)Set the current parameter and change the state of the objects.-
Methods inherited from class net.finmath.marketdata.model.curves.AbstractCurve
getName, getReferenceDate, getValue, getValues, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.finmath.marketdata.model.curves.CurveInterface
getName, getReferenceDate, getValue
-
-
-
-
Constructor Detail
-
SeasonalCurve
public SeasonalCurve(java.lang.String name, java.util.Calendar referenceDate, CurveInterface baseCurve)- Parameters:
name- The name of this curve.referenceDate- The reference date for this curve (i.e. t=0).baseCurve- The base curve, i.e., the discount curve used to calculate the seasonal adjustment factors.
-
-
Method Detail
-
getParameter
public double[] getParameter()
Description copied from interface:ParameterObjectInterfaceGet the current parameter associated with the state of the objects.- Specified by:
getParameterin interfaceParameterObjectInterface- Returns:
- The parameter.
-
setParameter
public void setParameter(double[] parameter)
Description copied from interface:ParameterObjectInterfaceSet the current parameter and change the state of the objects.- Specified by:
setParameterin interfaceParameterObjectInterface- Parameters:
parameter- The parameter associated with the new state of the objects.
-
getValue
public double getValue(AnalyticModelInterface model, double time)
Description copied from interface:CurveInterfaceReturns the value for the time using the interpolation method associated with this curve within a given context, i.e., a model. The model (context) is needed only if the curve relies on another curve. Examples are a forward curve which relies on a discount curve or a discount curve which is defined via a spread over another curve.- Specified by:
getValuein interfaceCurveInterface- Parameters:
model- An analytic model providing a context.time- Time for which the value should be returned.- Returns:
- The value at the give time.
-
getCloneForParameter
public CurveInterface getCloneForParameter(double[] value) throws java.lang.CloneNotSupportedException
Description copied from interface:ParameterObjectInterfaceCreate a clone with a modified parameter.- Specified by:
getCloneForParameterin interfaceParameterObjectInterface- Specified by:
getCloneForParameterin interfaceCurveInterface- Overrides:
getCloneForParameterin classAbstractCurve- Parameters:
value- The new parameter.- Returns:
- A clone with an otherwise modified parameter.
- Throws:
java.lang.CloneNotSupportedException- Thrown, when the curve could not be cloned.
-
clone
public SeasonalCurve clone() throws java.lang.CloneNotSupportedException
Description copied from interface:CurveInterfaceCreate a deep copied clone.- Specified by:
clonein interfaceCurveInterface- Overrides:
clonein classAbstractCurve- Returns:
- A clone (deep copied).
- Throws:
java.lang.CloneNotSupportedException- Thrown, when the curve could not be cloned.
-
getCloneBuilder
public CurveBuilderInterface getCloneBuilder() throws java.lang.CloneNotSupportedException
Description copied from interface:CurveInterfaceReturns a curve builder bases on a clone of this curve. Using that curve builder you may create a new curve from this curve by adding points or changing properties. Note: The clone has the same name than this one.- Specified by:
getCloneBuilderin interfaceCurveInterface- Returns:
- An object implementing the CurveBuilderInterface where the underlying curve is a clone of this curve.
- Throws:
java.lang.CloneNotSupportedException- Thrown, when this curve could not be cloned.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG