- java.lang.Object
-
- net.finmath.marketdata2.model.AnalyticModelFromCurvesAndVols
-
- All Implemented Interfaces:
Serializable,Cloneable,AnalyticModel,Model
public class AnalyticModelFromCurvesAndVols extends Object implements AnalyticModel, 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 termedAnalyticModelFromCuvesAndVols.- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AnalyticModelFromCurvesAndVols()Create an empty analytic model.AnalyticModelFromCurvesAndVols(Collection<Curve> curves)Create an analytic model with the given curves.AnalyticModelFromCurvesAndVols(Curve[] curves)Create an analytic model with the given curves.AnalyticModelFromCurvesAndVols(RandomVariableFactory abstractRandomVariableFactory)Create an empty analytic model using a given AbstractRandomVariableFactory for construction of result types.AnalyticModelFromCurvesAndVols(RandomVariableFactory abstractRandomVariableFactory, Curve[] curves)Create an analytic model with the given curves using a given AbstractRandomVariableFactory for construction of result types.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AnalyticModeladdCurve(String name, Curve curve)Add a reference to a given curve under a given name to this model.AnalyticModeladdCurve(Curve curve)AnalyticModeladdCurves(Set<Curve> curves)Create a new analytic model consisting of a clone of this one together with the given curves added.AnalyticModeladdCurves(Curve... curves)Create a new analytic model consisting of a clone of this one together with the given curves added.AnalyticModeladdVolatilitySurface(VolatilitySurface volatilitySurface)AnalyticModeladdVolatilitySurfaces(Set<VolatilitySurface> volatilitySurfaces)Create a new analytic model consisting of a clone of this one together with the given volatility surfaces added.AnalyticModeladdVolatilitySurfaces(VolatilitySurface... volatilitySurfaces)AnalyticModelFromCurvesAndVolsclone()AnalyticModelgetCloneForParameter(Map<ParameterObject,RandomVariable[]> curveParameterPairs)CurvegetCurve(String name)Get a curve by a given curve name.Map<String,Curve>getCurves()Returns an unmodifiable map of all curves.DiscountCurveInterfacegetDiscountCurve(String discountCurveName)Returns a discount curve for a given name.ForwardCurveInterfacegetForwardCurve(String forwardCurveName)Returns a forward curve for a given name.RandomVariablegetRandomVariableForConstant(double value)VolatilitySurfacegetVolatilitySurface(String name)Returns a volatility surface for a given name.Map<String,VolatilitySurface>getVolatilitySurfaces()Returns an unmodifiable map of all volatility surfaces.voidsetCurve(Curve curve)Deprecated.This class will become immutable.voidsetCurves(Curve[] curves)Deprecated.This class will become immutable.StringtoString()
-
-
-
Constructor Detail
-
AnalyticModelFromCurvesAndVols
public AnalyticModelFromCurvesAndVols()
Create an empty analytic model.
-
AnalyticModelFromCurvesAndVols
public AnalyticModelFromCurvesAndVols(RandomVariableFactory abstractRandomVariableFactory)
Create an empty analytic model using a given AbstractRandomVariableFactory for construction of result types.- Parameters:
abstractRandomVariableFactory- given AbstractRandomVariableFactory for construction of result types.
-
AnalyticModelFromCurvesAndVols
public AnalyticModelFromCurvesAndVols(Curve[] curves)
Create an analytic model with the given curves.- Parameters:
curves- The vector of curves.
-
AnalyticModelFromCurvesAndVols
public AnalyticModelFromCurvesAndVols(RandomVariableFactory abstractRandomVariableFactory, Curve[] curves)
Create an analytic model with the given curves using a given AbstractRandomVariableFactory for construction of result types.- Parameters:
abstractRandomVariableFactory- given AbstractRandomVariableFactory for construction of result types.curves- The vector of curves.
-
AnalyticModelFromCurvesAndVols
public AnalyticModelFromCurvesAndVols(Collection<Curve> curves)
Create an analytic model with the given curves.- Parameters:
curves- A collection of curves.
-
-
Method Detail
-
getRandomVariableForConstant
public RandomVariable getRandomVariableForConstant(double value)
- Specified by:
getRandomVariableForConstantin interfaceAnalyticModel
-
getCurve
public Curve getCurve(String name)
Description copied from interface:AnalyticModelGet a curve by a given curve name.- Specified by:
getCurvein interfaceAnalyticModel- 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,Curve> getCurves()
Description copied from interface:AnalyticModelReturns an unmodifiable map of all curves.- Specified by:
getCurvesin interfaceAnalyticModel- Returns:
- Map of all curves.
-
addCurve
public AnalyticModel addCurve(String name, Curve curve)
Description copied from interface:AnalyticModelAdd 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 interfaceAnalyticModel- 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 AnalyticModel addCurve(Curve curve)
-
addCurves
public AnalyticModel addCurves(Curve... curves)
Description copied from interface:AnalyticModelCreate a new analytic model consisting of a clone of this one together with the given curves added.- Specified by:
addCurvesin interfaceAnalyticModel- Parameters:
curves- The set of curves to add.- Returns:
- A new analytic model.
-
addCurves
public AnalyticModel addCurves(Set<Curve> curves)
Description copied from interface:AnalyticModelCreate a new analytic model consisting of a clone of this one together with the given curves added.- Specified by:
addCurvesin interfaceAnalyticModel- Parameters:
curves- The list of curves to add.- Returns:
- A new analytic model.
-
setCurve
@Deprecated public void setCurve(Curve curve)
Deprecated.This class will become immutable. Use addCurve instead.- Specified by:
setCurvein interfaceAnalyticModel
-
setCurves
@Deprecated public void setCurves(Curve[] curves)
Deprecated.This class will become immutable. Use addCurve instead.Set some curves.- Parameters:
curves- Array of curves to set.
-
getDiscountCurve
public DiscountCurveInterface getDiscountCurve(String discountCurveName)
Description copied from interface:AnalyticModelReturns a discount curve for a given name.- Specified by:
getDiscountCurvein interfaceAnalyticModel- 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:AnalyticModelReturns a forward curve for a given name.- Specified by:
getForwardCurvein interfaceAnalyticModel- 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 VolatilitySurface getVolatilitySurface(String name)
Description copied from interface:AnalyticModelReturns a volatility surface for a given name.- Specified by:
getVolatilitySurfacein interfaceAnalyticModel- Parameters:
name- THe name of the requested surface.- Returns:
- The volatility surface corresponding to the name.
-
getVolatilitySurfaces
public Map<String,VolatilitySurface> getVolatilitySurfaces()
Description copied from interface:AnalyticModelReturns an unmodifiable map of all volatility surfaces.- Specified by:
getVolatilitySurfacesin interfaceAnalyticModel- Returns:
- Map of all volatility surfaces.
-
addVolatilitySurface
public AnalyticModel addVolatilitySurface(VolatilitySurface volatilitySurface)
-
addVolatilitySurfaces
public AnalyticModel addVolatilitySurfaces(VolatilitySurface... volatilitySurfaces)
- Specified by:
addVolatilitySurfacesin interfaceAnalyticModel
-
addVolatilitySurfaces
public AnalyticModel addVolatilitySurfaces(Set<VolatilitySurface> volatilitySurfaces)
Description copied from interface:AnalyticModelCreate a new analytic model consisting of a clone of this one together with the given volatility surfaces added.- Specified by:
addVolatilitySurfacesin interfaceAnalyticModel- Parameters:
volatilitySurfaces- The list of volatility surfaces to add.- Returns:
- A new analytic model.
-
clone
public AnalyticModelFromCurvesAndVols clone()
- Specified by:
clonein interfaceAnalyticModel- Overrides:
clonein classObject
-
getCloneForParameter
public AnalyticModel getCloneForParameter(Map<ParameterObject,RandomVariable[]> curveParameterPairs) throws CloneNotSupportedException
- Specified by:
getCloneForParameterin interfaceAnalyticModel- Throws:
CloneNotSupportedException
-
-