finMath lib documentation
net.finmath.analytic.products

## Class Portfolio

• ### Constructor Detail

• #### Portfolio

public Portfolio(List<AnalyticProductInterface> products,
List<Double> weights)
Create a portfolio of products implementing AnalyticProductInterface. The portfolio consists of an array of products and a corresponding array of weights. The value of the portfolio is given by the sum over weights[i] * products.get(i).getValue(evaluationTime, model) Note that a product in the array of products may itself be a Portfolio (hence you may easily combine portfolios).
Parameters:
products - Array of products implementing AnalyticProductInterface.
weights - Array of weights used in the valuation as a multiplicator.
• #### Portfolio

public Portfolio(Portfolio portfolio,
List<AnalyticProductInterface> products,
List<Double> weights)
Create a portfolio of products implementing AnalyticProductInterface. The portfolio consists of an array of products and a corresponding array of weights. The value of the portfolio is given by the sum over weights[i] * products.get(i).getValue(evaluationTime, model) The portfolio is created by taking all products and weights of a given portfolio and adding other given products and weights.
Parameters:
portfolio - A given portfolio, which will become part of this portfolio.
products - Array of products implementing AnalyticProductInterface.
weights - Array of weights used in the valuation as a multiplicator.
• #### Portfolio

public Portfolio(AnalyticProductInterface product,
double weight)
Create a portfolio consisting of a single product with a given weight.
Parameters:
product - A product, implementing implementing AnalyticProductInterface.
weight - A weight used in the valuation as a multiplicator.
• #### Portfolio

public Portfolio(List<AnalyticProductInterface> products)
Create a portfolio of products implementing AnalyticProductInterface. The value of the portfolio is given by the sum over products.get(i).getValue(evaluationTime, model) Note that a product in the array of products may itself be a Portfolio (hence you may easily combine portfolios).
Parameters:
products - Array of products implementing AnalyticProductInterface.
• ### Method Detail

• #### getValue

public RandomVariableInterface getValue(double evaluationTime,
AnalyticModelInterface model)
Description copied from interface: AnalyticProductInterface
Return the valuation of the product using the given model. The model has to implement the modes of AnalyticModelInterface.
Specified by:
getValue in interface AnalyticProductInterface
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:
The value of the product using the given model.
• #### getWeights

public List<Double> getWeights()
Returns the list of weights as an unmodifiable list. Calling add on this list will result in an UnsupportedOperationException.
Returns:
The list of weights as an unmodifiable list.