net.finmath.marketdata.model
Class AnalyticModel
- java.lang.Object
-
- net.finmath.marketdata.model.AnalyticModel
-
- All Implemented Interfaces:
- java.lang.Cloneable, AnalyticModelInterface, ModelInterface
public class AnalyticModel extends java.lang.Object implements AnalyticModelInterface, java.lang.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 termedAnalyticModel.
-
-
Constructor Summary
Constructors Constructor and Description AnalyticModel()Create an empty analytic model.AnalyticModel(java.util.Collection<CurveInterface> curves)Create an analytic model with the given curves.AnalyticModel(CurveInterface[] curves)Create an analytic model with the given curves.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description AnalyticModelInterfaceaddCurve(CurveInterface curve)AnalyticModelInterfaceaddCurve(java.lang.String name, CurveInterface curve)Add a reference to a given curve under a given name to this model.AnalyticModelInterfaceaddCurves(CurveInterface... curves)Create a new analytic model consisting of a clone of this one together with the given curves added.AnalyticModelInterfaceaddCurves(java.util.Set<CurveInterface> curves)Create a new analytic model consisting of a clone of this one together with the given curves added.AnalyticModelInterfaceaddVolatilitySurface(VolatilitySurfaceInterface volatilitySurface)AnalyticModelInterfaceaddVolatilitySurfaces(java.util.Set<AbstractVolatilitySurface> volatilitySurfaces)Create a new analytic model consisting of a clone of this one together with the given volatility surfaces added.AnalyticModelInterfaceaddVolatilitySurfaces(VolatilitySurfaceInterface... volatilitySurfaces)AnalyticModelclone()AnalyticModelInterfacegetCloneForParameter(java.util.Map<ParameterObjectInterface,double[]> curveParameterPairs)CurveInterfacegetCurve(java.lang.String name)Get a curve by a given curve name.DiscountCurveInterfacegetDiscountCurve(java.lang.String discountCurveName)ForwardCurveInterfacegetForwardCurve(java.lang.String forwardCurveName)VolatilitySurfaceInterfacegetVolatilitySurface(java.lang.String name)voidsetCurve(CurveInterface curve)Deprecated.This class will become immutable. Use addCurve instead.voidsetCurves(CurveInterface[] curves)Deprecated.This class will become immutable. Use addCurve instead.voidsetVolatilitySurface(VolatilitySurfaceInterface volatilitySurface)Deprecated.This class will become immutable. Use addVolatilitySurface instead.
-
-
-
Constructor Detail
-
AnalyticModel
public AnalyticModel()
Create an empty analytic model.
-
AnalyticModel
public AnalyticModel(CurveInterface[] curves)
Create an analytic model with the given curves.- Parameters:
curves- The vector of curves.
-
AnalyticModel
public AnalyticModel(java.util.Collection<CurveInterface> curves)
Create an analytic model with the given curves.- Parameters:
curves- A collection of curves.
-
-
Method Detail
-
getCurve
public CurveInterface getCurve(java.lang.String name)
Description copied from interface:AnalyticModelInterfaceGet a curve by a given curve name.- Specified by:
getCurvein interfaceAnalyticModelInterface- 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.
-
addCurve
public AnalyticModelInterface addCurve(java.lang.String name, CurveInterface curve)
Description copied from interface:AnalyticModelInterfaceAdd a reference to a given curve under a given name to this model. It is not necessary that the name given agrees withcurve.getName(). This method comes in handy, if you like to create curve mappings.- Specified by:
addCurvein interfaceAnalyticModelInterface- 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.
-
addCurve
public AnalyticModelInterface addCurve(CurveInterface curve)
-
addCurves
public AnalyticModelInterface addCurves(CurveInterface... curves)
Description copied from interface:AnalyticModelInterfaceCreate a new analytic model consisting of a clone of this one together with the given curves added.- Specified by:
addCurvesin interfaceAnalyticModelInterface- Parameters:
curves- The set of curves to add.- Returns:
- A new analytic model.
-
addCurves
public AnalyticModelInterface addCurves(java.util.Set<CurveInterface> curves)
Description copied from interface:AnalyticModelInterfaceCreate a new analytic model consisting of a clone of this one together with the given curves added.- Specified by:
addCurvesin interfaceAnalyticModelInterface- Parameters:
curves- The list of curves to add.- Returns:
- A new analytic model.
-
setCurve
@Deprecated public void setCurve(CurveInterface curve)
Deprecated. This class will become immutable. Use addCurve instead.- Specified by:
setCurvein interfaceAnalyticModelInterface
-
setCurves
@Deprecated public void setCurves(CurveInterface[] curves)
Deprecated. This class will become immutable. Use addCurve instead.Set some curves.- Parameters:
curves- Array of curves to set.
-
getDiscountCurve
public DiscountCurveInterface getDiscountCurve(java.lang.String discountCurveName)
- Specified by:
getDiscountCurvein interfaceAnalyticModelInterface
-
getForwardCurve
public ForwardCurveInterface getForwardCurve(java.lang.String forwardCurveName)
- Specified by:
getForwardCurvein interfaceAnalyticModelInterface
-
getVolatilitySurface
public VolatilitySurfaceInterface getVolatilitySurface(java.lang.String name)
- Specified by:
getVolatilitySurfacein interfaceAnalyticModelInterface
-
addVolatilitySurface
public AnalyticModelInterface addVolatilitySurface(VolatilitySurfaceInterface volatilitySurface)
-
addVolatilitySurfaces
public AnalyticModelInterface addVolatilitySurfaces(VolatilitySurfaceInterface... volatilitySurfaces)
- Specified by:
addVolatilitySurfacesin interfaceAnalyticModelInterface
-
addVolatilitySurfaces
public AnalyticModelInterface addVolatilitySurfaces(java.util.Set<AbstractVolatilitySurface> volatilitySurfaces)
Description copied from interface:AnalyticModelInterfaceCreate a new analytic model consisting of a clone of this one together with the given volatility surfaces added.- Specified by:
addVolatilitySurfacesin interfaceAnalyticModelInterface- Parameters:
volatilitySurfaces- The list of volatility surfaces to add.- Returns:
- A new analytic model.
-
setVolatilitySurface
@Deprecated public void setVolatilitySurface(VolatilitySurfaceInterface volatilitySurface)
Deprecated. This class will become immutable. Use addVolatilitySurface instead.- Specified by:
setVolatilitySurfacein interfaceAnalyticModelInterface
-
clone
public AnalyticModel clone()
- Specified by:
clonein interfaceAnalyticModelInterface- Overrides:
clonein classjava.lang.Object
-
getCloneForParameter
public AnalyticModelInterface getCloneForParameter(java.util.Map<ParameterObjectInterface,double[]> curveParameterPairs) throws java.lang.CloneNotSupportedException
- Specified by:
getCloneForParameterin interfaceAnalyticModelInterface- Throws:
java.lang.CloneNotSupportedException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG