finMath lib documentation
net.finmath.marketdata.model

Class AnalyticModel

• All Implemented Interfaces:
Serializable, Cloneable, AnalyticModelInterface, ModelInterface
Direct Known Subclasses:
AnalyticModelFactory.DescribedAnalyticModel

public class AnalyticModel
extends Object
implements AnalyticModelInterface, Serializable, Cloneable
Implements a collection of market data objects (e.g., discount curves, forward curve) which provide interpolation of market data or other derived quantities ("calibrated curves"). This can be seen as a model to be used in analytic pricing formulas - hence this class is termed AnalyticModel.
Version:
1.0
Author:
Christian Fries
Serialized Form
• Constructor Summary

Constructors
Constructor and Description
AnalyticModel()
Create an empty analytic model.
AnalyticModel(Collection<CurveInterface> curves)
Create an analytic model with the given curves.
AnalyticModel(CurveInterface[] curves)
Create an analytic model with the given curves.
AnalyticModel(LocalDate referenceDate)
Create an empty analytic model for a specified date.
AnalyticModel(LocalDate referenceDate, Collection<CurveInterface> curves)
Create an analytic model with the given curves for the specified reference date.
AnalyticModel(LocalDate referenceDate, CurveInterface[] curves)
Create an analytic model with the given curves for the specified reference date.
AnalyticModel(LocalDate referenceDate, Map<String,CurveInterface> curvesMap, Map<String,VolatilitySurfaceInterface> volatilitySurfaceMap)
Create an analytic model for the specified reference date, together with curves and volatility surfaces, each with their specific name.
• Method Summary

All Methods
Modifier and Type Method and Description
AnalyticModelInterface addCurve(CurveInterface curve)
AnalyticModelInterface addCurve(String name, CurveInterface curve)
Add a reference to a given curve under a given name to this model.
AnalyticModelInterface addCurves(CurveInterface... curves)
Create a new analytic model consisting of a clone of this one together with the given curves added.
AnalyticModelInterface addCurves(Set<CurveInterface> curves)
Create a new analytic model consisting of a clone of this one together with the given curves added.
AnalyticModelInterface addVolatilitySurface(VolatilitySurfaceInterface volatilitySurface)
AnalyticModelInterface addVolatilitySurfaces(Set<VolatilitySurfaceInterface> volatilitySurfaces)
Create a new analytic model consisting of a clone of this one together with the given volatility surfaces added.
AnalyticModelInterface addVolatilitySurfaces(VolatilitySurfaceInterface... volatilitySurfaces)
AnalyticModel clone()
AnalyticModelInterface getCloneForParameter(Map<ParameterObjectInterface,double[]> curveParameterPairs)
CurveInterface getCurve(String name)
Get a curve by a given curve name.
Map<String,CurveInterface> getCurves()
Returns an unmodifiable map of all curves.
DiscountCurveInterface getDiscountCurve(String discountCurveName)
Returns a discount curve for a given name.
ForwardCurveInterface getForwardCurve(String forwardCurveName)
Returns a forward curve for a given name.
LocalDate getReferenceDate()
Returns the reference date of the curves of this model.
VolatilitySurfaceInterface getVolatilitySurface(String name)
Returns a volatility surface for a given name.
Map<String,VolatilitySurfaceInterface> getVolatilitySurfaces()
Returns an unmodifiable map of all volatility surfaces.
void setCurve(CurveInterface curve)
Deprecated.
void setCurves(CurveInterface[] curves)
Deprecated.
void setVolatilitySurface(VolatilitySurfaceInterface volatilitySurface)
Deprecated.
String toString()
• Methods inherited from class java.lang.Object

equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
• Constructor Detail

• AnalyticModel

public AnalyticModel()
Create an empty analytic model.
• AnalyticModel

public AnalyticModel(LocalDate referenceDate)
Create an empty analytic model for a specified date.
Parameters:
referenceDate - The reference date that should be used for all curves and surfaces of this model.
• AnalyticModel

public AnalyticModel(CurveInterface[] curves)
Create an analytic model with the given curves.
Parameters:
curves - The vector of curves.
• AnalyticModel

public AnalyticModel(Collection<CurveInterface> curves)
Create an analytic model with the given curves.
Parameters:
curves - A collection of curves.
• AnalyticModel

public AnalyticModel(LocalDate referenceDate,
CurveInterface[] curves)
Create an analytic model with the given curves for the specified reference date.
Parameters:
referenceDate - The reference date that should be used for all curves and surfaces of this model.
curves - The vector of curves.
• AnalyticModel

public AnalyticModel(LocalDate referenceDate,
Collection<CurveInterface> curves)
Create an analytic model with the given curves for the specified reference date.
Parameters:
referenceDate - The reference date that should be used for all curves and surfaces of this model.
curves - A collection of curves.
• AnalyticModel

public AnalyticModel(LocalDate referenceDate,
Map<String,CurveInterface> curvesMap,
Map<String,VolatilitySurfaceInterface> volatilitySurfaceMap)
Create an analytic model for the specified reference date, together with curves and volatility surfaces, each with their specific name.
Parameters:
referenceDate - The reference date that should be used for all curves and surfaces of this model.
curvesMap - A map containing all curves, together with their names they should have in the model.
volatilitySurfaceMap - A map containing all volatility surfaces, together with their names they should have in the model.
• Method Detail

• getCurve

public CurveInterface getCurve(String name)
Description copied from interface: AnalyticModelInterface
Get a curve by a given curve name.
Specified by:
getCurve in interface AnalyticModelInterface
Parameters:
name - The name of the curve.
Returns:
The curve with the corresponding name, given that it is part of this model, otherwise null is return.
• getCurves

public Map<String,CurveInterface> getCurves()
Description copied from interface: AnalyticModelInterface
Returns an unmodifiable map of all curves.
Specified by:
getCurves in interface AnalyticModelInterface
Returns:
Map of all curves.

public AnalyticModelInterface addCurve(String name,
CurveInterface curve)
Description copied from interface: AnalyticModelInterface
Add a reference to a given curve under a given name to this model. It is not necessary that the name given agrees with curve.getName(). This method comes in handy, if you like to create curve mappings.
Specified by:
addCurve in interface AnalyticModelInterface
Parameters:
name - Name under which the curve is known in the model.
curve - The curve.
Returns:
A clone of this model, containing the curves of this model which are not known under the given name and the new curve under the given name.

public AnalyticModelInterface addCurve(CurveInterface curve)

public AnalyticModelInterface addCurves(CurveInterface... curves)
Description copied from interface: AnalyticModelInterface
Create a new analytic model consisting of a clone of this one together with the given curves added.
Specified by:
addCurves in interface AnalyticModelInterface
Parameters:
curves - The set of curves to add.
Returns:
A new analytic model.

public AnalyticModelInterface addCurves(Set<CurveInterface> curves)
Description copied from interface: AnalyticModelInterface
Create a new analytic model consisting of a clone of this one together with the given curves added.
Specified by:
addCurves in interface AnalyticModelInterface
Parameters:
curves - The list of curves to add.
Returns:
A new analytic model.
• setCurve

@Deprecated
public void setCurve(CurveInterface curve)
Specified by:
setCurve in interface AnalyticModelInterface
• setCurves

@Deprecated
public void setCurves(CurveInterface[] curves)
Set some curves.
Parameters:
curves - Array of curves to set.
• getDiscountCurve

public DiscountCurveInterface getDiscountCurve(String discountCurveName)
Description copied from interface: AnalyticModelInterface
Returns a discount curve for a given name.
Specified by:
getDiscountCurve in interface AnalyticModelInterface
Parameters:
discountCurveName - The name of the requested curve.
Returns:
discount curve corresponding to discountCurveName or null if no discountCurve with this name exists in the model
• getForwardCurve

public ForwardCurveInterface getForwardCurve(String forwardCurveName)
Description copied from interface: AnalyticModelInterface
Returns a forward curve for a given name.
Specified by:
getForwardCurve in interface AnalyticModelInterface
Parameters:
forwardCurveName - The name of the requested curve.
Returns:
forward curve corresponding to forwardCurveName or null if no forwardCurve with this name exists in the model
• getVolatilitySurface

public VolatilitySurfaceInterface getVolatilitySurface(String name)
Description copied from interface: AnalyticModelInterface
Returns a volatility surface for a given name.
Specified by:
getVolatilitySurface in interface AnalyticModelInterface
Parameters:
name - THe name of the requested surface.
Returns:
The volatility surface corresponding to the name.
• getVolatilitySurfaces

public Map<String,VolatilitySurfaceInterface> getVolatilitySurfaces()
Description copied from interface: AnalyticModelInterface
Returns an unmodifiable map of all volatility surfaces.
Specified by:
getVolatilitySurfaces in interface AnalyticModelInterface
Returns:
Map of all volatility surfaces.

public AnalyticModelInterface addVolatilitySurface(VolatilitySurfaceInterface volatilitySurface)

public AnalyticModelInterface addVolatilitySurfaces(VolatilitySurfaceInterface... volatilitySurfaces)
Specified by:
addVolatilitySurfaces in interface AnalyticModelInterface

public AnalyticModelInterface addVolatilitySurfaces(Set<VolatilitySurfaceInterface> volatilitySurfaces)
Description copied from interface: AnalyticModelInterface
Create a new analytic model consisting of a clone of this one together with the given volatility surfaces added.
Specified by:
addVolatilitySurfaces in interface AnalyticModelInterface
Parameters:
volatilitySurfaces - The list of volatility surfaces to add.
Returns:
A new analytic model.
• setVolatilitySurface

@Deprecated
public void setVolatilitySurface(VolatilitySurfaceInterface volatilitySurface)
Specified by:
setVolatilitySurface in interface AnalyticModelInterface
• clone

public AnalyticModel clone()
Specified by:
clone in interface AnalyticModelInterface
Overrides:
clone in class Object
• getCloneForParameter

public AnalyticModelInterface getCloneForParameter(Map<ParameterObjectInterface,double[]> curveParameterPairs)
throws CloneNotSupportedException
Specified by:
getCloneForParameter in interface AnalyticModelInterface
Throws:
CloneNotSupportedException
• toString

public String toString()
Overrides:
toString in class Object
• getReferenceDate

public LocalDate getReferenceDate()
Returns the reference date of the curves of this model.
Returns:
The reference date of the model.