- java.lang.Object
-
- net.finmath.montecarlo.AbstractMonteCarloProduct
-
- net.finmath.montecarlo.products.PortfolioMonteCarloProduct
-
- All Implemented Interfaces:
Product
,MonteCarloProduct
public class PortfolioMonteCarloProduct extends AbstractMonteCarloProduct
A portfolio of products, each product being of AbstractMonteCarloProduct type. The valuation is performed multi-threaded over the portfolio of products.- Version:
- 1.0
- Author:
- Christian Fries
-
-
Constructor Summary
Constructors Constructor Description PortfolioMonteCarloProduct(MonteCarloProduct[] products)
Create a portfolio of products, each product being of AbstractMonteCarloProduct type.PortfolioMonteCarloProduct(MonteCarloProduct[] products, double[] weights)
Create a portfolio of products, each product being of AbstractMonteCarloProduct type and weighted with a given weight.PortfolioMonteCarloProduct(MonteCarloProduct[] products, double[] weights, Optional<Integer> numberOfThreads)
Create a portfolio of products, each product being of AbstractMonteCarloProduct type and weighted with a given weight.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RandomVariable
getValue(double evaluationTime, MonteCarloSimulationModel model)
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.-
Methods inherited from class net.finmath.montecarlo.AbstractMonteCarloProduct
getCurrency, getValue, getValue, getValues, getValues, getValues, getValuesForModifiedData, getValuesForModifiedData, getValuesForModifiedData, getValuesForModifiedData, toString
-
-
-
-
Constructor Detail
-
PortfolioMonteCarloProduct
public PortfolioMonteCarloProduct(MonteCarloProduct[] products, double[] weights, Optional<Integer> numberOfThreads)
Create a portfolio of products, each product being of AbstractMonteCarloProduct type and weighted with a given weight.- Parameters:
products
- An array of products.weights
- An array of weights.numberOfThreads
- Number of parallel threads to used. Required to be > 0.
-
PortfolioMonteCarloProduct
public PortfolioMonteCarloProduct(MonteCarloProduct[] products, double[] weights)
Create a portfolio of products, each product being of AbstractMonteCarloProduct type and weighted with a given weight.- Parameters:
products
- An array of products.weights
- An array of weights.
-
PortfolioMonteCarloProduct
public PortfolioMonteCarloProduct(MonteCarloProduct[] products)
Create a portfolio of products, each product being of AbstractMonteCarloProduct type.- Parameters:
products
- An array of products.
-
-
Method Detail
-
getValue
public 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 interfaceMonteCarloProduct
- Specified by:
getValue
in classAbstractMonteCarloProduct
- 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.
-
-