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 termed
AnalyticModelFromCuvesAndVols
.- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionCreate 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 randomVariableFactory)
Create an empty analytic model using a given AbstractRandomVariableFactory for construction of result types.AnalyticModelFromCurvesAndVols(RandomVariableFactory randomVariableFactory, Curve[] curves)
Create an analytic model with the given curves using a given AbstractRandomVariableFactory for construction of result types. -
Method Summary
Modifier and TypeMethodDescriptionAdd a reference to a given curve under a given name to this model.Create a new analytic model consisting of a clone of this one together with the given curves added.Create a new analytic model consisting of a clone of this one together with the given curves added.addVolatilitySurface(VolatilitySurface volatilitySurface)
addVolatilitySurfaces(Set<VolatilitySurface> volatilitySurfaces)
Create a new analytic model consisting of a clone of this one together with the given volatility surfaces added.addVolatilitySurfaces(VolatilitySurface... volatilitySurfaces)
clone()
getCloneForParameter(Map<ParameterObject,RandomVariable[]> curveParameterPairs)
Get a curve by a given curve name.Returns an unmodifiable map of all curves.getDiscountCurve(String discountCurveName)
Returns a discount curve for a given name.getForwardCurve(String forwardCurveName)
Returns a forward curve for a given name.getRandomVariableForConstant(double value)
getVolatilitySurface(String name)
Returns a volatility surface for a given name.Returns an unmodifiable map of all volatility surfaces.void
Deprecated.This class will become immutable.void
Deprecated.This class will become immutable.toString()
-
Constructor Details
-
AnalyticModelFromCurvesAndVols
public AnalyticModelFromCurvesAndVols()Create an empty analytic model. -
AnalyticModelFromCurvesAndVols
Create an empty analytic model using a given AbstractRandomVariableFactory for construction of result types.- Parameters:
randomVariableFactory
- given AbstractRandomVariableFactory for construction of result types.
-
AnalyticModelFromCurvesAndVols
Create an analytic model with the given curves.- Parameters:
curves
- The vector of curves.
-
AnalyticModelFromCurvesAndVols
Create an analytic model with the given curves using a given AbstractRandomVariableFactory for construction of result types.- Parameters:
randomVariableFactory
- given AbstractRandomVariableFactory for construction of result types.curves
- The vector of curves.
-
AnalyticModelFromCurvesAndVols
Create an analytic model with the given curves.- Parameters:
curves
- A collection of curves.
-
-
Method Details
-
getRandomVariableForConstant
- Specified by:
getRandomVariableForConstant
in interfaceAnalyticModel
-
getCurve
Description copied from interface:AnalyticModel
Get a curve by a given curve name.- Specified by:
getCurve
in 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
Description copied from interface:AnalyticModel
Returns an unmodifiable map of all curves.- Specified by:
getCurves
in interfaceAnalyticModel
- Returns:
- Map of all curves.
-
addCurve
Description copied from interface:AnalyticModel
Add 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:
addCurve
in 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
-
addCurves
Description copied from interface:AnalyticModel
Create a new analytic model consisting of a clone of this one together with the given curves added.- Specified by:
addCurves
in interfaceAnalyticModel
- Parameters:
curves
- The set of curves to add.- Returns:
- A new analytic model.
-
addCurves
Description copied from interface:AnalyticModel
Create a new analytic model consisting of a clone of this one together with the given curves added.- Specified by:
addCurves
in interfaceAnalyticModel
- Parameters:
curves
- The list of curves to add.- Returns:
- A new analytic model.
-
setCurve
Deprecated.This class will become immutable. Use addCurve instead.- Specified by:
setCurve
in interfaceAnalyticModel
-
setCurves
Deprecated.This class will become immutable. Use addCurve instead.Set some curves.- Parameters:
curves
- Array of curves to set.
-
getDiscountCurve
Description copied from interface:AnalyticModel
Returns a discount curve for a given name.- Specified by:
getDiscountCurve
in 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
Description copied from interface:AnalyticModel
Returns a forward curve for a given name.- Specified by:
getForwardCurve
in 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
Description copied from interface:AnalyticModel
Returns a volatility surface for a given name.- Specified by:
getVolatilitySurface
in interfaceAnalyticModel
- Parameters:
name
- THe name of the requested surface.- Returns:
- The volatility surface corresponding to the name.
-
getVolatilitySurfaces
Description copied from interface:AnalyticModel
Returns an unmodifiable map of all volatility surfaces.- Specified by:
getVolatilitySurfaces
in interfaceAnalyticModel
- Returns:
- Map of all volatility surfaces.
-
addVolatilitySurface
-
addVolatilitySurfaces
- Specified by:
addVolatilitySurfaces
in interfaceAnalyticModel
-
addVolatilitySurfaces
Description copied from interface:AnalyticModel
Create a new analytic model consisting of a clone of this one together with the given volatility surfaces added.- Specified by:
addVolatilitySurfaces
in interfaceAnalyticModel
- Parameters:
volatilitySurfaces
- The list of volatility surfaces to add.- Returns:
- A new analytic model.
-
clone
- Specified by:
clone
in interfaceAnalyticModel
- Overrides:
clone
in classObject
-
getCloneForParameter
public AnalyticModel getCloneForParameter(Map<ParameterObject,RandomVariable[]> curveParameterPairs) throws CloneNotSupportedException- Specified by:
getCloneForParameter
in interfaceAnalyticModel
- Throws:
CloneNotSupportedException
-
toString
-