Class 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.
    The getValue 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, calling getAverage on this random variable will result in the value. Otherwise a conditional expectation has to be applied.
    Version:
    1.3
    Author:
    Christian Fries
    • 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 index underlyingIndex from the model - single asset case).
        Parameters:
        underlyingName - Name of the underlying
        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).
      • 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 interface AssetMonteCarloProduct
        Specified by:
        getValue in class AbstractAssetMonteCarloProduct
        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 the cause() 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 interface MonteCarloProduct
        Specified by:
        getValues in interface Product
        Overrides:
        getValues in class AbstractMonteCarloProduct
        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.