Class AbstractMonteCarloProduct

    • Constructor Detail

      • AbstractMonteCarloProduct

        public AbstractMonteCarloProduct​(String currency)
      • AbstractMonteCarloProduct

        public AbstractMonteCarloProduct()
    • Method Detail

      • getValue

        public Object getValue​(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:
        getValue in interface MonteCarloProduct
        Specified by:
        getValue in interface Product
        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:
        Object containing the value of the product using the given model.
      • 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
        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.
      • getValue

        public abstract RandomVariable getValue​(double evaluationTime,
                                                MonteCarloSimulationModel model)
                                         throws CalculationException
        Description copied from interface: MonteCarloProduct
        This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime. 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. More generally: The value random variable is a random variable V*(t) such that the time-t conditional expectation of V*(t) is equal to the value of the financial product in time t. An example for V*(t) is the sum of t-discounted payoffs. Cashflows prior evaluationTime are not considered.
        Specified by:
        getValue in interface MonteCarloProduct
        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,
                                                  MonteCarloSimulationModel model)
                                           throws CalculationException
        Description copied from interface: MonteCarloProduct
        This method returns the value of the product under the specified model and other information in a key-value map.
        Specified by:
        getValues in interface MonteCarloProduct
        Parameters:
        evaluationTime - The time on which this products value should be observed.
        model - A model used to evaluate the product.
        Returns:
        The values of the product.
        Throws:
        CalculationException - Thrown if the valuation fails, specific cause may be available via the cause() method.
      • getValuesForModifiedData

        public Map<String,​Object> getValuesForModifiedData​(double evaluationTime,
                                                                 MonteCarloSimulationModel model,
                                                                 Map<String,​Object> dataModified)
                                                          throws CalculationException
        Description copied from interface: MonteCarloProduct
        This method returns the value under shifted market data (or model parameters). In its default implementation it does bump (creating a new model) and revalue. Override the way the new model is created, to implemented improved techniques (proxy scheme, re-calibration).
        Specified by:
        getValuesForModifiedData in interface MonteCarloProduct
        Parameters:
        evaluationTime - The time on which this products value should be observed.
        model - The model used to price the product, except for the market data to modify
        dataModified - The new market data object to use (could be of different types)
        Returns:
        The values of the product.
        Throws:
        CalculationException - Thrown if the valuation fails, specific cause may be available via the cause() method.
      • getValuesForModifiedData

        public Map<String,​Object> getValuesForModifiedData​(double evaluationTime,
                                                                 MonteCarloSimulationModel model,
                                                                 String entityKey,
                                                                 Object dataModified)
                                                          throws CalculationException
        Description copied from interface: MonteCarloProduct
        This method returns the value under shifted market data (or model parameters). In its default implementation it does bump (creating a new model) and revalue. Override the way the new model is created, to implemented improved techniques (proxy scheme, re-calibration).
        Specified by:
        getValuesForModifiedData in interface MonteCarloProduct
        Parameters:
        evaluationTime - The time on which this products value should be observed.
        model - The model used to price the product, except for the market data to modify
        entityKey - The entity to change, it depends on the model if the model reacts to this key.
        dataModified - The new market data object to use (could be of different types)
        Returns:
        The values of the product.
        Throws:
        CalculationException - Thrown if the valuation fails, specific cause may be available via the cause() method.
      • getValuesForModifiedData

        public Map<String,​Object> getValuesForModifiedData​(MonteCarloSimulationModel model,
                                                                 Map<String,​Object> dataModified)
                                                          throws CalculationException
        Description copied from interface: MonteCarloProduct
        This method returns the value under shifted market data (or model parameters). In its default implementation it does bump (creating a new model) and revalue. Override the way the new model is created, to implemented improved techniques (proxy scheme, re-calibration).
        Specified by:
        getValuesForModifiedData in interface MonteCarloProduct
        Parameters:
        model - The model used to price the product, except for the market data to modify
        dataModified - The new market data object to use (could be of different types)
        Returns:
        The values of the product.
        Throws:
        CalculationException - Thrown if the valuation fails, specific cause may be available via the cause() method.
      • getValuesForModifiedData

        public Map<String,​Object> getValuesForModifiedData​(MonteCarloSimulationModel model,
                                                                 String entityKey,
                                                                 Object dataModified)
                                                          throws CalculationException
        Description copied from interface: MonteCarloProduct
        This method returns the value under shifted market data (or model parameters). In its default implementation it does bump (creating a new model) and revalue. Override the way the new model is created, to implemented improved techniques (proxy scheme, re-calibration).
        Specified by:
        getValuesForModifiedData in interface MonteCarloProduct
        Parameters:
        model - The model used to price the product, except for the market data to modify
        entityKey - The entity to change, it depends on the model if the model reacts to this key.
        dataModified - The new market data object to use (could be of different types)
        Returns:
        The values of the product.
        Throws:
        CalculationException - Thrown if the valuation fails, specific cause may be available via the cause() method.