Module net.finmath.lib
Class EuropeanOption
- java.lang.Object
-
- net.finmath.montecarlo.AbstractMonteCarloProduct
-
- net.finmath.montecarlo.assetderivativevaluation.products.AbstractAssetMonteCarloProduct
-
- net.finmath.montecarlo.assetderivativevaluation.products.EuropeanOption
-
- All Implemented Interfaces:
Product
,AssetMonteCarloProduct
,MonteCarloProduct
- Direct Known Subclasses:
SingleAssetMonteCarloProductFactory.EuropeanOptionMonteCarlo
public class EuropeanOption extends AbstractAssetMonteCarloProduct
Implements the valuation of a European option on a single asset. Given a model for an asset S, the European option with strike K, maturity T pays
V(T) = max(S(T) - K , 0) in T.
ThegetValue
method of this class will return the random variable N(t) * V(T) / N(T), where N is the numeraire provided by the model. If N(t) is deterministic, callinggetAverage
on this random variable will result in the value. Otherwise a conditional expectation has to be applied.- Version:
- 1.3
- Author:
- Christian Fries
-
-
Constructor Summary
Constructors Constructor Description EuropeanOption(double maturity, double strike)
Construct a product representing an European option on an asset S (where S the asset with index 0 from the model - single asset case).EuropeanOption(double maturity, double strike, int underlyingIndex)
Construct a product representing an European option on an asset S (where S the asset with index 0 from the model - single asset case).EuropeanOption(String underlyingName, double maturity, double strike)
Construct a product representing an European option on an asset S (where S the asset with indexunderlyingIndex
from the model - single asset case).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getMaturity()
String
getNameOfUnderliyng()
double
getStrike()
Integer
getUnderlyingIndex()
RandomVariable
getValue(double evaluationTime, AssetModelMonteCarloSimulationModel model)
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.Map<String,Object>
getValues(double evaluationTime, Model model)
Return the valuation of the product using the given model.String
toString()
-
Methods inherited from class net.finmath.montecarlo.assetderivativevaluation.products.AbstractAssetMonteCarloProduct
getValue
-
Methods inherited from class net.finmath.montecarlo.AbstractMonteCarloProduct
getCurrency, getValue, getValue, getValues, getValues, getValuesForModifiedData, getValuesForModifiedData, getValuesForModifiedData, getValuesForModifiedData
-
-
-
-
Constructor Detail
-
EuropeanOption
public EuropeanOption(String underlyingName, double maturity, double strike)
Construct a product representing an European option on an asset S (where S the asset with indexunderlyingIndex
from the model - single asset case).- Parameters:
underlyingName
- Name of the underlyingmaturity
- The maturity T in the option payoff max(S(T)-K,0)strike
- The strike K in the option payoff max(S(T)-K,0).
-
EuropeanOption
public EuropeanOption(double maturity, double strike, int underlyingIndex)
Construct a product representing an European option on an asset S (where S the asset with index 0 from the model - single asset case).- Parameters:
maturity
- The maturity T in the option payoff max(S(T)-K,0)strike
- The strike K in the option payoff max(S(T)-K,0).underlyingIndex
- The index of the underlying to be fetched from the model.
-
EuropeanOption
public EuropeanOption(double maturity, double strike)
Construct a product representing an European option on an asset S (where S the asset with index 0 from the model - single asset case).- Parameters:
maturity
- The maturity T in the option payoff max(S(T)-K,0)strike
- The strike K in the option payoff max(S(T)-K,0).
-
-
Method Detail
-
getValue
public RandomVariable getValue(double evaluationTime, AssetModelMonteCarloSimulationModel model) throws CalculationException
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime. Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time. Cashflows prior evaluationTime are not considered.- Specified by:
getValue
in interfaceAssetMonteCarloProduct
- Specified by:
getValue
in classAbstractAssetMonteCarloProduct
- Parameters:
evaluationTime
- The time on which this products value should be observed.model
- The model used to price the product.- Returns:
- The random variable representing the value of the product discounted to evaluation time
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getValues
public Map<String,Object> getValues(double evaluationTime, Model model)
Description copied from interface:Product
Return the valuation of the product using the given model. Implement this method using a checked cast of the model to a derived model for which the product provides a valuation algorithm. Example: an interest rate product requires that the passed model object implements the interface of an interest rate model. Since there is no polymorphism on arguments (see Double Dynamic Dispatch), we reply on a checked cast.- Specified by:
getValues
in interfaceMonteCarloProduct
- Specified by:
getValues
in interfaceProduct
- Overrides:
getValues
in classAbstractMonteCarloProduct
- Parameters:
evaluationTime
- The evaluation time as double. Cash flows prior and including this time are not considered.model
- The model under which the product is valued.- Returns:
- Map containing the value of the product using the given model.
-
toString
public String toString()
- Overrides:
toString
in classAbstractMonteCarloProduct
-
getMaturity
public double getMaturity()
-
getStrike
public double getStrike()
-
getUnderlyingIndex
public Integer getUnderlyingIndex()
-
getNameOfUnderliyng
public String getNameOfUnderliyng()
-
-