public class Portfolio extends AbstractAnalyticProduct implements AnalyticProduct
AnalyticProductInterface.| Constructor and Description |
|---|
Portfolio(AnalyticProduct product,
double weight)
Create a portfolio consisting of a single product with a given weight.
|
Portfolio(List<AnalyticProduct> products)
Create a portfolio of products implementing
AnalyticProductInterface. |
Portfolio(List<AnalyticProduct> products,
List<Double> weights)
Create a portfolio of products implementing
AnalyticProductInterface. |
Portfolio(Portfolio portfolio,
List<AnalyticProduct> products,
List<Double> weights)
Create a portfolio of products implementing
AnalyticProductInterface. |
| Modifier and Type | Method and Description |
|---|---|
List<AnalyticProduct> |
getProducts()
Returns the list of products as an unmodifiable list.
|
double |
getValue(double evaluationTime,
AnalyticModel model)
Return the valuation of the product using the given model.
|
List<Double> |
getWeights()
Returns the list of weights as an unmodifiable list.
|
getValue, getValuepublic Portfolio(List<AnalyticProduct> products, List<Double> weights)
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).products - Array of products implementing AnalyticProductInterface.weights - Array of weights used in the valuation as a multiplicator.public Portfolio(Portfolio portfolio, List<AnalyticProduct> products, List<Double> weights)
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.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.public Portfolio(AnalyticProduct product, double weight)
product - A product, implementing implementing AnalyticProductInterface.weight - A weight used in the valuation as a multiplicator.public Portfolio(List<AnalyticProduct> products)
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).products - Array of products implementing AnalyticProductInterface.public double getValue(double evaluationTime,
AnalyticModel model)
AnalyticProductAnalyticModel.getValue in interface AnalyticProductevaluationTime - The evaluation time as double. Cash flows prior and including this time are not considered.model - The model under which the product is valued.public List<AnalyticProduct> getProducts()
add on this list will result in an UnsupportedOperationException.public List<Double> getWeights()
add on this list will result in an UnsupportedOperationException.Copyright © 2019. All rights reserved.