WebCab Portfolio Demo
v4.2
(J2EE Edition)

com.webcab.ejb.finance.portfolio
Interface CapitalMarketLocal

All Superinterfaces:
EJBLocalObject

public interface CapitalMarketLocal
extends EJBLocalObject

Local interface of CapitalMarket. This interface provides the same functionality as the CapitalMarket remote interface.

See Also:
CapitalMarket

Method Summary
 void calculateEfficientFrontier(double[][] covarianceMatrix, double[] expectedReturns, int numberInterpolationPoints, double precision)
          Method calculateEfficientFrontier(double[][], double[], int, double) as defined in the CapitalMarket remote interface.
 void calculateEfficientFrontier(double minimumExpectedReturn, double maximumExpectedReturn, double[][] covarianceMatrix, double[] expectedReturns, int numberInterpolationPoints, double precision)
          Method calculateEfficientFrontier(double, double, double[][], double[], int, double) as defined in the CapitalMarket remote interface.
 double[] getLowerConstraints()
          Method getLowerConstraints() as defined in the CapitalMarket remote interface.
 double[] getUpperConstraints()
          Method getUpperConstraints() as defined in the CapitalMarket remote interface.
 double[] marketPortfolio(double[][] covarianceMatrix, double[] expectedReturns)
          Method marketPortfolio(double[][], double[]) as defined in the CapitalMarket remote interface.
 double[] marketPortfolio(double minimumExpectedReturn, double maximumExpectedReturn, double[][] covarianceMatrix)
          Method marketPortfolio(double, double, double[][]) as defined in the CapitalMarket remote interface.
 double marketPortfolioExpectedReturn(double[] weights, double[][] historicalReturns)
          Method marketPortfolioExpectedReturn(double[], double[][]) as defined in the CapitalMarket remote interface.
 double marketPortfolioRisk(double[] weights, double[][] covariance)
          Method marketPortfolioRisk(double[], double[][]) as defined in the CapitalMarket remote interface.
 double maxFrontierReturn(double[] expectedReturns)
          Method maxFrontierReturn(double[]) as defined in the CapitalMarket remote interface.
 double[] maxFrontierReturnWeights(double[] expectedReturns)
          Method maxFrontierReturnWeights(double[]) as defined in the CapitalMarket remote interface.
 double minFrontierReturn(double[] expectedReturns)
          Method minFrontierReturn(double[]) as defined in the CapitalMarket remote interface.
 double[] minFrontierReturnWeights(double[] expectedReturns)
          Method minFrontierReturnWeights(double[]) as defined in the CapitalMarket remote interface.
 double returnCML(double risk, double equityRisk, double equityExpected, double marketRate)
          Method returnCML(double, double, double, double) as defined in the CapitalMarket remote interface.
 double riskCML(double expectedReturn, double equityExpected, double marketRate, double equityRisk)
          Method riskCML(double, double, double, double) as defined in the CapitalMarket remote interface.
 void setConstraints(double[] lowerBounds, double[] upperBounds)
          Method setConstraints(double[], double[]) as defined in the CapitalMarket remote interface.
 double weight2Risk(double weighting, double equityRisk)
          Method weight2Risk(double, double) as defined in the CapitalMarket remote interface.
 double weightCML(double expectedReturn, double equityExpected, double marketRate)
          Method weightCML(double, double, double) as defined in the CapitalMarket remote interface.
 
Methods inherited from interface javax.ejb.EJBLocalObject
getEJBLocalHome, getPrimaryKey, isIdentical, remove
 

Method Detail

calculateEfficientFrontier

public void calculateEfficientFrontier(double minimumExpectedReturn,
                                       double maximumExpectedReturn,
                                       double[][] covarianceMatrix,
                                       double[] expectedReturns,
                                       int numberInterpolationPoints,
                                       double precision)
                                throws NoSolutionException,
                                       CapitalMarketDemoException
Method calculateEfficientFrontier(double, double, double[][], double[], int, double) as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

Calculates the interpolation points used in order to construct the Efficient Frontier with a given range of expected returns for a collection of assets from which the optimal portfolio can be constructed. Note that the weights of the assets from which the portfolio may be constructed may be subject to constraints (see notes below).

Overview

A constrained optimization algorithm is used each time to find the portfolios which have the least risk for a given set of expected returns. In fact, an optimization algorithm which is computational intensive will need to be called for each evaluation of an interpolation point. These interpolation points will then be interpolated in order to the construct the Efficient Frontier over the range of expected returns considered.

Constraining the Weights of the assets of the Efficient Frontier's Portfolios

With our implementation we offer the possibility to constrain the weights of the assets from which the portfolios on the Efficient Frontier are constructed. The constraints on the weights on the portfolios are set by using the method setConstraints. We illustrate the use constraints with the following example.

Say an investor requires a portfolio selected from n assets which has the lowest risk for a given expected return but also has the requirement that all of the assets must have a weight between 0.05 and 0.1 (i.e. between 5 and 10 percent). In this instance we would need to set the constraints on the assets to be:

lowerBounds = {0.05, 0.05, 0.05,...., 0.05}
upperBounds = {0.1, 0.1, 0.1, ......, 0.1}

where each of the arrays above has n terms, using the method setConstraints.

Remark: If the constraints are not set then they will take there default values which are 0 and 1, for the lower bound respectively upper bound of each asset. That is, they will remain as weights in the usual sense.

Selecting the range of the Expected Returns

We allow the user to restrict the range of expected returns over which the Efficient Frontier is evaluated since:

In short, the minimum and maximum of the expected return give a range over which the (possibly constrained) Efficient Frontier is evaluated. Once the range is set, the interpolation points (i.e. the set of expected returns) is used to equally divide up the range and the Efficient Frontier's interpolation points are evaluated (only) within this range. By excluding sections of the Efficient Frontier will allow more interpolation points to be evaluated within the range of expected returns of interest for a given computation effort.

Remark: For a given range the more interpolation points are evaluated the more accurately the Efficient Frontier will be represented which will result in to greater accuracy of the construction of the optimal portfolio.

Evaluating the Range of the expected returns on the Efficient Frontier

As mentioned before the points on the (constrained) Efficient Frontier correspond to portfolios which can be constructed from a given set of available assets where the sum of the weightings of the assets sum to 1. Therefore, (since the expected return is additive) the range of expected returns will lie within the range of expected returns of the assets. Below we consider the exact range of the value of the expected return for which the (constrained) Efficient Frontier exists.

Within this Enterprise JavaBean we offer the two methods minFrontierReturn(double[]) and maxFrontierReturn(double[]) which evaluate the upper bounds and lower bounds respectively of the range of the expected returns over which the Efficient Frontier exists for the given set of asset considered. If you set the range of expected returned considered to lie outside this range then an exception will be thrown.

Remarks on the Range of expected returns of the Unconstrained Efficient Frontier

If the weights of the assets are not constrained then the range of expected returns (i.e. all possible optimal portfolios) will lie in the continuous range given by:

Remarks on the Range of expected returns of the Constrained Efficient Frontier

In the case where the weights of the assets from which the portfolios on the Efficient Frontier can be constructed are constrained. The range of the expected return for which the constrained Efficient Frontier may exist may not cover the full range of values of expected returns of the assets. The reason being that the asset with the highest (resp. lowest) expected return may have an upper bound in which case you are not able to construct the portfolio solely of this asset because at all time the weights of the assets must sum to 1.

The Range of the Expected Returns and Performance considerations

The way in which you set the range of expected returns considered will depend on the nature of the problem you are considering. If you are considering a portfolio optimization problem in which the portfolio is constructed from a relatively few number of assets (for example, less than 30) then each evaluation of another interpolation points will be very rapid and hence as long as the total number of interpolation points which you wish to use over the total range is reasonable (i.e. less than 30) then the evaluation of the Efficient Frontier will take a few seconds. However, if you are considering a larger number of assets (for example, more than 80) then you may wish to considered only a proportion of the Efficient Frontier (i.e. a smaller range of expected values) so that you will need to evaluate of fewer number of interpolation points in order to construct the Efficient Frontier over that range to the desired level of accuracy.

Remark: The computational time increase in proportion to the number interpolation points returned.

Number of Interpolation Points used to represent the Efficient Frontier

The Efficient Frontier is persisted (i.e. stored) as the collection of points around which it is interpolated. Therefore, the more interpolation points used within this method the more accurately it will be stored. However, within the construction of the Efficient Frontier the main optimization algorithm is called when each interpolation point is evaluated. Therefore, in terms of performance the computational time required for the construction of the Efficient Frontier will increase in proportion to the number of points used.

As a rule of thumb I would suggest that the number of interpolation points used is chosen within the range [5,20]. The rationale being that if less than five interpolation points are used then unreasonable amounts of qualitative information concerning the Efficient Frontier will be lost. Also, if more than twenty interpolation points are used then (generally speaking) no significant improvement in the accuracy will result.

Effect of this method on the CapitalMarket Enterprise JavaBean

All methods within the CapitalMarket Enterprise JavaBean are either directly or indirectly effected by the evaluation of the Efficient Frontier. The reason for this is that the returned values by all methods depend on the Efficient Frontier, moreover the Market Portfolio and then the optimal portfolios accordance to the CAMP require that the Efficient Frontier is constructed.

The methods within this Enterprise JavaBean which are directly effected (in fact, require) the construction and setting of the private fields which make up the Efficient Frontier are:

  1. calculateEfficientFrontier - Each portfolio on the Efficient Frontier must satisfy the constraints on the assets.
  2. marketPortfolio - The Market Portfolio itself since selected from the portfolios on the Efficient Frontier must also satisfy the constraints on the assets by which these portfolios can be constructed.

The other methods (and the CAPM in general) of this Enterprise JavaBean rely on the Market Portfolio and therefore are also effected (however indirectly) by the construction of the Efficient Frontier.

Evaluation of the Covariance matrix and Expected Returns

You are required to provide to this method the covariance matrix and the expected returns of the collection of asset from which the portfolio's on the Efficient Frontier are constructed. We provide within the AssetParameters Enterprise JavaBean procedures which assist in there evaluation of the covariance matrix and the expected returns via either an historical or scenario approach.

Parameters:
minimumExpectedReturn - the minimum expected return for which the Efficient Frontier is evaluated. If you require the entire Efficient Frontier to be evaluated then you may set this parameter to be equal to the return of the assets with the minimum return. Note that this parameter should be given as a percentage (i.e. 1 percent = 1).
maximumExpectedReturn - the maximum expected return for which the Efficient Frontier is evaluated. If you require the entire Efficient Frontier to be evaluated then you may set this parameter to be equal to the return of the assets with the maximum return. Note that this parameter should be given as a percentage (i.e. 1 percent = 1).
expectedReturns - the array of the expected returns of the assets from which the portfolios can be constructed. Where the k-th term will correspond to the percentage return (i.e. 1 percent = 1) or the absolute return of the k-th asset from the set of assets from which the Portfolios (on the Efficient Frontier) can be constructed.
covarianceMatrix - the covariance matrix of the assets from which the (optimal) portfolio can be constructed. The dimensions of the (symmetric) covariance matrix will be n X n, where n is the number of assets from which the (optimal) portfolio can be constructed.
numberInterpolationPoints - the number of interpolation points for which the Efficient Frontier is calculated. Note that these interpolation points lie within the interval bound by the minimum and maximum expected returns set and be equally dispersed within this interval. Moreover, in all case one of the interpolation points will lie of the minimum expected return set and another will lie on the maximum expected return set.
precision - this parameters allow the level of the precision required to be set, where the small the parameters the (generally) higher the precision. This variable should be chosen between the range 1E-2 and 1E-10. Note as with most numerical procedures the higher the precision the more computationally intensive the algorithm will become. The precision must be set to be a positive number less than 1; where a number of the magnitude 1E-6 will result in high precision and a number of the magnitude 1E-3 will result in rapid execution and acceptable precision for most purposes. Further details are provided within the Programmer's guide chapter of the PDF documentation.
Throws:
NoSolutionException - thrown if this method attempts to construct a portfolio on the Efficient Frontier for an expected return for which there does not exist such a portfolio. In such instances the range of expected returns over which the Efficient Frontier is constructed should be reduced. Please see the remarks above on the selection of a suitable range of expected returns.
CapitalMarketDemoException
See Also:
CapitalMarket.calculateEfficientFrontier(double, double, double[][], double[], int, double)

calculateEfficientFrontier

public void calculateEfficientFrontier(double[][] covarianceMatrix,
                                       double[] expectedReturns,
                                       int numberInterpolationPoints,
                                       double precision)
                                throws CapitalMarketDemoException
Method calculateEfficientFrontier(double[][], double[], int, double) as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

This method calls the calculateEfficientFrontier by setting the range of the expected returns over which the Efficient Frontier is evaluated to be the entire range over which the (constrained) Efficient Frontier exists.

For more details concerning the issues effecting the constraints, efficiency, number of interpolation points use and so on...; we refer the reader to the documentation for the method calculateEfficientFrontier. As mentioned above the only difference with the aforementioned method at that here the range of expected returns have been set as detail below.

Range of Expected Returns

The range over which the (constrained) Efficient Frontier is evaluated can be evaluated by using the methods minFrontierReturn, maxFrontierReturn; in order to evaluate the minimum and maximum of the continuous range of the expected return over which the Efficient Frontier exists for the given set of assets considered. Note that with this procedure we have set the range over which the Efficient Frontier is constructed to be equal to this largest possible range.

Parameters:
expectedReturns - the array of the expected returns of the assets from which the portfolios can be constructed. Where the k-th term will correspond to the percentage return (i.e. 1 percent = 1) or the absolute return of the k-th asset from the set of assets from which the Portfolios (on the Efficient Frontier) can be constructed.
covarianceMatrix - the covariance matrix of the assets from which the (optimal) portfolio can be constructed. The dimensions of the (symmetric) covariance matrix will be n X n, where n is the number of assets from which the (optimal) portfolio can be constructed.
numberInterpolationPoints - the number of interpolation points for which the Efficient Frontier is calculated. Note that these interpolation points lie within the interval bound by the minimum and maximum expected returns set and be equally dispersed within this interval. Moreover, in all case one of the interpolation points will lie of the minimum expected return set and another will lie on the maximum expected return set.
precision - this parameters allow the level of the precision required to be set, where the small the parameters the (generally) higher the precision. This variable should be chosen between the range 1E-2 and 1E-10. Note as with most numerical procedures the higher the precision the more computationally intensive the algorithm will become. The precision must be set to be a positive number less than 1; where a number of the magnitude 1E-6 will result in high precision and a number of the magnitude 1E-3 will result in rapid execution and acceptable precision for most purposes. Further details are provided within the Programmer's guide chapter of the PDF documentation.
CapitalMarketDemoException
See Also:
CapitalMarket.calculateEfficientFrontier(double[][], double[], int, double)

setConstraints

public void setConstraints(double[] lowerBounds,
                           double[] upperBounds)
                    throws CapitalMarketDemoException
Method setConstraints(double[], double[]) as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

Here we allow constraints to be placed on the weights of the assets from which the portfolios within the Efficient Frontier will be constructed. All methods which depend on the construction of the Efficient Frontier, are effected by imposing the constraints on the assets of the Efficient Frontier.

Effect of Constraints on the CapitalMarket Enterprise JavaBean

All methods within the CapitalMarket Enterprise JavaBean are either directly or indirectly effected by the setting of constraints on the weights of the assets from which the portfolios on the Efficient Frontier are constructed by calculateEfficientFrontier. The reason for this is that the returned values by all methods depend on the Efficient Frontier which is in turn effected by the setting of asset weight constraints.

The methods within this Enterprise JavaBean which are directly effected by the setting of constraints on the weights of the assets from which the portfolios on the Efficient Frontier are constructed are:

  1. calculateEfficientFrontier - Each portfolio on the Efficient Frontier must satisfy the constraints on the assets.
  2. marketPortfolio - The Market Portfolio itself since selected from the portfolios on the Efficient Frontier must also satisfy the constraints on the assets by which these portfolios can be constructed.

The other methods (and the CAPM in general) of this Enterprise JavaBean rely on the Market Portfolio and therefore are also effected (however indirectly) by the setting of constraints.

Nature of the Constraints

We illustrate the nature of the constraints with the following example. Say an investor requires a portfolio selected from n asset which has the lowest risk for a given expected return but also has the requirement that all of the assets must have a weight between 0.05 and 0.1 (i.e. between 5 and 10 percent). In this instance we would set the constraints on the assets to be:

lowerBounds = {0.05, 0.05, 0.05,...., 0.05}
upperBounds = {0.1, 0.1, 0.1, ......, 0.1}

where each of the arrays above has n terms.

Constraints have Default Values

If the constraints are not set then they take there default values which are 0 and 1, for the lower and upper bound respectively for each asset weight.

Performance Issues

The introduction of constraints on the weights of the portfolios which form the Efficient Frontier will have the following consequences with regards to overall performance:

Remarks:

Motivation and Definition of Consistent Asset Constraints

Say that we wish to use place the following `Constraints' on a portfolio which can be constructed from 3 assets:

  1. lower bounds = {0.4, 0.4, 0.4}
  2. upper bounds = {0.5, 0.5, 0.5}
because the sum of the weights of a portfolio must be 1, there is no `consistent' portfolio which can be constructed which satisfies these constraints and the definition of the weight. Since even if we take the lower bounds for each of the three assets the sum of the weights is greater than 1 (i.e. 0.4 + 0.4 + 0.4 = 1.2 > 1).

Similarly, say we wish to use the following set of constraints:

  1. lower bounds = {0.2, 0.2, 0.2}
  2. upper bounds = {0.3, 0.3, 0.3}
as mentioned above since the sum of the weights of a portfolio must equal one, there are no portfolios which can be constructed which are `consistent' the definition that the weights must sum to 1. Since even if we take the upper bounds for each of the three assets the sum of the weights is less than 1 (i.e. 0.3 + 0.3 + 0.3 = 0.9 < 1).

For these reason reasons we introduce the following property of `consistent constraints':

Definition: A set of upper and lower bound asset constraints of a portfolio are said to be consistent if the sum of the lower bounds is less than or equal to 1, and the sum of the upper bounds is greater than or equal to 1.

Without the `consistent constraint' condition there will not exist any possible selections of the asset weights which satisfy the constraints and the definition of the asset weights, i.e. the domain of possible portfolios will be empty. Therefore this condition of consistency of the constraints is mandatory for any set of constraints used within the construction of the constrained Portfolios on the constrained Efficient Frontier.

Constraints on the Asset Weights effect on the range of the Expected Returns for which the Efficient Frontier exists

The placing of constraints on the weights of the assets effects the range of expected returns for which the resulting portfolios can be constructed. Since the (constrained) Efficient Frontier is just a collection of portfolios subject also subject to the constraints which minimize the risk for a given level of the expected return. The range of values over which the Efficient Frontier exists must correspond to the range of expected returns of the possible constructed portfolios.

Within the methods maxFrontierReturn(double[]), and minFrontierReturn(double[]) we allow the maximum and respectively minimum values of the expected return over which the (possibly constrained) Efficient Frontier exists. We also offer two associated methods maxFrontierReturnWeights(double[]) and minFrontierReturnWeights(double[]), which evaluate the assets weights of the portfolio at these two ends points. These methods which construct the Portfolios on the Efficient Frontier at its end points have the significant advantage of having almost no computational overhead, unlike the construction of the portfolios on the Efficient Frontier at other points.

Parameters:
lowerBounds - an array where the i-th term corresponds to the lower bound on the weights (i.e. lies in the closed interval [0,1]) of the i-th asset from the collection of assets from which the portfolios can be constructed. Note that the length of this array must equal the number of assets from which the portfolios can be constructed.
upperBounds - an array where the i-th term corresponds to the upper bound on the weights (i.e. lies in the closed interval [0,1]) of the i-th asset from the collection of assets from which the portfolios can be constructed. Note that the length of this array must equal the number of assets from which the portfolios can be constructed.
CapitalMarketDemoException
See Also:
CapitalMarket.setConstraints(double[], double[])

getLowerConstraints

public double[] getLowerConstraints()
                             throws CapitalMarketDemoException
Method getLowerConstraints() as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

Returns the values of the lower bound constraints on the asset weights set by setConstraints. We return an array where the k-th term of the array corresponds to the lower bound on the k-th asset's weight.

CapitalMarketDemoException
See Also:
CapitalMarket.getLowerConstraints()

getUpperConstraints

public double[] getUpperConstraints()
                             throws CapitalMarketDemoException
Method getUpperConstraints() as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

Returns the values of the upper bound constraints on the asset weights set by setConstraints. We return an array where the k-th term of the array corresponds to the upper bound on the k-th asset's weight.

CapitalMarketDemoException
See Also:
CapitalMarket.getUpperConstraints()

minFrontierReturn

public double minFrontierReturn(double[] expectedReturns)
                         throws CapitalMarketDemoException
Method minFrontierReturn(double[]) as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

Returns the expected return of the portfolio on the Efficient Frontier with the lowest value of the expected return.

Advantage of this approach

The distinct advantage of this approach is that in conjunction with the method minFrontierReturnWeights we are able to evaluate a point (at the lower end of the extremum of the expected returns) corresponding to a portfolio on the Efficient Frontier. Where unlike the situation with the optimization procedures calculateEfficientFrontier, we are able to do so with almost no computational overhead.

Parameters:
expectedReturns - the array of the expected returns of the assets from which the portfolios can be constructed. Where the k-th term will correspond to the percentage return (i.e. 1 percent = 1) or the absolute return of the k-th asset from the set of assets from which the Portfolios (on the Efficient Frontier) can be constructed.
CapitalMarketDemoException
See Also:
minFrontierReturnWeights(double[]), CapitalMarket.minFrontierReturn(double[])

minFrontierReturnWeights

public double[] minFrontierReturnWeights(double[] expectedReturns)
                                  throws CapitalMarketDemoException
Method minFrontierReturnWeights(double[]) as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

Returns the weights of the assets within the portfolio on the (constraints) Efficient Frontier which has the highest value of the expected return.

Advantage of this approach

The distinct advantage of this approach is that in conjunction with the method minFrontierReturn we are able to evaluate a point (at the lower end of the extremum of the expected returns) corresponding to a portfolio on the Efficient Frontier. Where unlike the situation with the optimization procedures calculateEfficientFrontier, we are able to do so with almost no computational overhead.

Parameters:
expectedReturns - the array of the expected returns of the assets from which the portfolios can be constructed. Where the k-th term will correspond to the percentage return (i.e. 1 percent = 1) or the absolute return of the k-th asset from the set of assets from which the Portfolios (on the Efficient Frontier) can be constructed.
CapitalMarketDemoException
See Also:
minFrontierReturn(double[]), CapitalMarket.minFrontierReturnWeights(double[])

maxFrontierReturn

public double maxFrontierReturn(double[] expectedReturns)
                         throws CapitalMarketDemoException
Method maxFrontierReturn(double[]) as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

Evaluates the expected return of the portfolio on the (constrained) Efficient Frontier with the highest value of the expected return.

Advantage of this approach

The distinct advantage of this approach is that in conjunction with the method minFrontierReturnWeights we are able to evaluate a point (at the upper end of the extremum of the expected returns) corresponding to a portfolio on the Efficient Frontier. Where unlike the situation with the optimization procedures calculateEfficientFrontier, we are able to do so with almost no computational overhead.

Parameters:
expectedReturns - the array of the expected returns of the assets from which the portfolios can be constructed. Where the k-th term will correspond to the percentage return (i.e. 1 percent = 1) or the absolute return of the k-th asset from the set of assets from which the Portfolios (on the Efficient Frontier) can be constructed.
CapitalMarketDemoException
See Also:
maxFrontierReturnWeights(double[]), CapitalMarket.maxFrontierReturn(double[])

maxFrontierReturnWeights

public double[] maxFrontierReturnWeights(double[] expectedReturns)
                                  throws CapitalMarketDemoException
Method maxFrontierReturnWeights(double[]) as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

Returns the weights of the assets of the portfolio on the (constrained) Efficient Frontier with the highest value of the expected return.

Advantage of this approach

The distinct advantage of this approach is that in conjunction with the method maxFrontierReturn we are able to evaluate a point (at the upper end of the extremum of the expected returns) corresponding to a portfolio on the Efficient Frontier. Where unlike the situation with the optimization procedures calculateEfficientFrontier, we are able to do so with almost no computational overhead.

Parameters:
expectedReturns - the array of the expected returns of the assets from which the portfolios can be constructed. Where the k-th term will correspond to the percentage return (i.e. 1 percent = 1) or the absolute return of the k-th asset from the set of assets from which the Portfolios (on the Efficient Frontier) can be constructed.
CapitalMarketDemoException
See Also:
maxFrontierReturn(double[]), CapitalMarket.maxFrontierReturnWeights(double[])

marketPortfolio

public double[] marketPortfolio(double minimumExpectedReturn,
                                double maximumExpectedReturn,
                                double[][] covarianceMatrix)
                         throws EfficientFrontierNotCalculatedException,
                                CapitalMarketDemoException
Method marketPortfolio(double, double, double[][]) as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

Calculates the optimal portfolio which consists of a composition of assets which optimizes the portfolios risk/return profile. The optimization occurs along the Efficient Frontier in a given range of the expected returns. We return an array of weights where the first term corresponds to the weight of the first asset from the collection of assets, the second term to the weight of the second asset and so on.

Dependency of this Construction

The Market Portfolio is found by searching along the (possibly constrained) Efficient Frontier and therefore before this methods is called and the Market Portfolio sort; the constraints on the assets should be set and the corresponding the Efficient Frontier should be constructed. You are able to set the constraints on the asset weights by calling setConstraints, and then the (possibly constrained) Efficient Frontier can be constructed by calling the following two methods: calculateEfficientFrontier over an interval, or calculateEfficientFrontier over entire range. Please note that if the Efficient Frontier is only constructed over an interval then the interval over which it is constructed must be at least as big as the interval over which the Market Portfolio is sort using this method.

Selection of the Minimum and Maximum Expected Returns

By carefully selecting the parameters for the minimum and maximum expected returns over which the Market Portfolio will be selected from the Efficient Frontier you will be able to increase efficient of this method. However, unless you have a good idea as to the likely range in which the Market Portfolio is likely lie we suggest that you take these parameters to define with widest possible range. The largest range is achieved by considering the same range over which the Efficient Frontier was evaluated.

Parameters:
minimumExpectedReturn - the minimum expected return of the portfolios on the Efficient Frontier over which the Market Portfolio will be sort. Note that, the minimum used here must be larger than or equal to the minimum used in the evaluation of the Efficient Frontier in calculateEfficientFrontier.
maximumExpectedReturn - the maximum expected return of the portfolios on the Efficient Frontier over which the Market Portfolio will be sort. Note that, the minimum used here must be less than or equal to the maximum used in the evaluation of the Efficient Frontier is calculateEfficientFrontier.
covarianceMatrix - the covariance matrix of the assets which can be used to construct the Market Portfolio (and all the other portfolios on the Efficient Frontier). Note that within applications when applying this method the covariance matrix will most likely already be evaluated in the construction of the Efficient Frontier using the method calculateEfficientFrontier.
Returns:
An array of weights of the assets from which the Market Portfolio can be constructed.
Throws:
EfficientFrontierNotCalculatedException - thrown if the Efficient Frontier has not been evaluated using calculateEfficientFrontier.
CapitalMarketDemoException
See Also:
CapitalMarket.marketPortfolio(double, double, double[][])

marketPortfolio

public double[] marketPortfolio(double[][] covarianceMatrix,
                                double[] expectedReturns)
                         throws EfficientFrontierNotCalculatedException,
                                CapitalMarketDemoException
Method marketPortfolio(double[][], double[]) as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

This method calls marketPortfolio on the entire range of the values of the expected returns in which the Market Portfolio could lie. This range of values of the expected returns corresponds exactly to the range over which the Efficient Frontier exists.

For more details concerning the issues effecting the constraints, efficiency, number of interpolation points use and so on...; we refer the reader to the documentation for the method marketPortfolio. As mentioned above the only difference with the aforementioned method at that here the range of the expected returns have been set as detail below.

Range over which the Expected Returns are set

The range over which the expected returns are set and hence the (constrained) Efficient Frontier is evaluated can be evaluated by using the methods minFrontierReturn, maxFrontierReturn; in order to evaluate the minimum and maximum of the continuous range of the expected return over which the Efficient Frontier exists for the given set of assets considered. Note that with this procedure we have set the range over which the Efficient Frontier is constructed to be equal to this largest possible range.

Dependency of this Construction

The Market Portfolio is found by searching along the (possibly constrained) Efficient Frontier and therefore before this methods is called and the Market Portfolio sort; the constraints on the assets should be set and the corresponding the Efficient Frontier should be constructed. You are able to set the constraints on the asset weights by calling setConstraints, and then the (possibly constrained) Efficient Frontier over the entire possible range of values of the expected returns can be constructed by calling the method: calculateEfficientFrontier. Please note that if the Efficient Frontier most be constructed over the entire possible range of expected returns because the interval over which it is constructed must be at least as big as the interval over which the Market Portfolio is sort which here in the entire range.

Parameters:
covarianceMatrix - the covariance matrix of the assets from which the (optimal) portfolio can be constructed. The dimensions of the (symmetric) covariance matrix will be n X n, where n is the number of assets from which the (optimal) portfolio can be constructed.
expectedReturns - the array of the expected returns of the assets from which the portfolios can be constructed. Where the k-th term will correspond to the percentage return (i.e. 1 percent = 1) or the absolute return of the k-th asset from the set of assets from which the Portfolios (on the Efficient Frontier) can be constructed.
EfficientFrontierNotCalculatedException
CapitalMarketDemoException
See Also:
marketPortfolio(double, double, double[][]), minFrontierReturn(double[]), maxFrontierReturn(double[]), CapitalMarket.marketPortfolio(double[][], double[])

marketPortfolioExpectedReturn

public double marketPortfolioExpectedReturn(double[] weights,
                                            double[][] historicalReturns)
                                     throws CapitalMarketDemoException
Method marketPortfolioExpectedReturn(double[], double[][]) as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

Evaluates the expected return of the Market Portfolio when the asset weights of the Market Portfolio are known. The (possibly constrained) asset weights of the market portfolio should be evaluated prior to the application of this method user marketPortfolio.

Remark: The historical returns of the assets used here will correspond to the historical returns of the asset which was used in the evaluation of the (possibly constrained) Efficient Frontier.

Approach used here and other options

Within this method we evaluate the expected returns of the assets from there historical values using a historical approach. That is, the present expected return is estimated to be the arithmetic average of the previous historical expected returns. A weighted average is then used in order to estimate the expected return. This should be the default means by which the (present) expected return of the Market Portfolio is estimated. However, there are a number of competing approaches which you may wish to use; these include:

  1. Scenario Approach as provided within AssetParameters.expectedReturn(double[], double[])

Parameters:
weights - the (possibly constrained) weights of the (risky) assets from which the Market Portfolio was constructed. These weights can be evaluated by using the method marketPortfolio.
historicalReturns - historicalReturns[i][t] is the return (in absolute or relative percentage terms) of the i-th asset of the collect in the tth period. Note that if the absolute (resp. percentage) returns are used then the estimated expected return will be expressed in absolute (resp. relative percentage) terms. Moreover, if the daily returns are used then the estimated return will be an estimate of the daily return and so on.
Returns:
A double equal to the expected return of the Market Portfolio.
CapitalMarketDemoException
See Also:
CapitalMarket.marketPortfolioExpectedReturn(double[], double[][])

marketPortfolioRisk

public double marketPortfolioRisk(double[] weights,
                                  double[][] covariance)
                           throws CapitalMarketDemoException
Method marketPortfolioRisk(double[], double[][]) as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

Evaluates the total risk of the Market Portfolio. The (possibly constrained) asset weights of the Market Portfolio should be evaluated prior to the application of this method user marketPortfolio.

Remark: The covariance matrix of the assets from which the Market Portfolio can be constructed will correspond to the covariance matrix used in the evaluated of the Efficient Frontier which must be evaluated before the Market Portfolio can be constructed.

Application time span and approaches to estimating the Covariance Matrix

The portfolio risk is an instantaneous quantity and therefore the covariances between the asset used within this method (and the Efficient Frontier) should also be instantaneous. However, in practice it is difficult to estimate the instantaneous value of the covariance matrix. We provide within the Asset Parameters class the following two methods:

  1. AssetParameters.covarianceMatrix(double[][]) - Historical Estimate.
  2. AssetParameters.covarianceMatrix(double[], double[][]) - Scenario based estimate.

The first approach is backward looking using the historical values and the second approach is forward looking. However, both approaches will tend to estimate the mean covariances over a period rather than the instantaneous value. This may not cause significant problems since in practice it is often an estimate of the risk over a period which is considered. However, in order to obtain the most suitable estimate for a given application the user should match the estimation procedure with the time period over which the estimate is desired. For example, if we desire to estimate the gain which diversification could have brought if a portfolio was rebalanced one month ago then the use of the historical approach using asset prices from the last month would be appropriate in the evaluation of the covariance.

Parameters:
weights - the (possibly constrained) weights of the assets from which the Market Portfolio was constructed evaluated by using the method marketPortfolio. Note, that the first terms of this array is the weights of the first asset from the collection of asset from which the Market Portfolio can be constructed, the second term is the weight of the second asset and so on.
Returns:
A double equal to the risk of the Market Portfolio.
CapitalMarketDemoException
See Also:
CapitalMarket.marketPortfolioRisk(double[], double[][])

weightCML

public double weightCML(double expectedReturn,
                        double equityExpected,
                        double marketRate)
                 throws CapitalMarketDemoException
Method weightCML(double, double, double) as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

For a given level of the expected return we evaluate the proportion of the investors wealth to invest in the Market Portfolio (as constructed in marketPortfolio) such that we have the Capital Market Line (CML) portfolio which offers to lowest risk for the given level of the expected return.

Further Explanation

In order to evaluate the weighting of the Market Portfolio we are required to provide the expected return of the desired portfolio on the CML, the expected return of the Market Portfolio and the prevailing market rate at which cash can be borrowed or lent to the market. The market rate at which cash can by borrow or lend should be known but the expected return of the Market Portfolio should be evaluated using marketPortfolioExpectedReturn. Which in turn requires that the Market Portfolio in known, which can be constructed using marketPortfolio, which depends firstly the asset weights constraints (if applicable) being set using setConstraints before the Efficient Frontier is constructed using calculateEfficientFrontier.

Remark:

Completeness of the Methods: weightCML, returnCML, riskCML, weight2Risk

The portfolio on the CML can be selected from knowledge of its total risk, expected return or weight of the Market Portfolio. Then using the above mentioned methods we are able to evaluate the other quantities which are not given. For example, if the expected return of the portfolio is known then the weight of the market portfolio can be evaluated using weightCML and the risk can be evaluated using riskCML. If on the other hand the total risk of the portfolio is known then the corresponding expected return of the portfolio can be evaluated by returnCML, and then using this deduced value we are able to evaluated the weight of the Market Portfolio using weightCML. For completeness we include the method weight2Risk which evaluates the risk of a portfolio on the CML when the weight of the Market Portfolio within the CML portfolio is known. From knowledge of the risk of the CML portfolio we able to evaluate the corresponding value of the expected return using the method returnCML.

Therefore, using the three `...CML' methods along with `weight2Risk', which one of: total risk, expected return or weight of Market Portfolio, is used in order to selected the portfolio from the CML we are able to deduce the other two quantitative properties.

Remarks on time units and the percentage convention used

Within the application of this method you are required to provide a number of of parameters which are quoted within respect to a given period of time, such as `per year', `per month' and so on. Within the application of this method it is important to point out that the time unit used for each of these parameters should correspond. For instance the expected return of the desired portfolio, expected return of the Market Portfolio and the market rate at which money can be lent or borrowed which are each given in decimal format (i.e. 1 percent = 0.01) should be given with respect to the same unit of time. Moreover, the returned value of the expected return of the portfolio on the CML will also be expressed with respect to the same unit of time and in decimal format (i.e. 1 percent = 0.01).

Parameters:
expectedReturn - the expected return of the portfolio desired by the investor given in decimal format (i.e. 1 percent = 0.01)
equityExpected - the expected return from the Market Portfolio which is constructed by the method marketPortfolio, which can then be evaluated using the method marketPortfolioExpectedReturn. Note that the expected return should be given in decimal format (i.e. 1 percent = 0.01)
marketRate - the fixed rate at which the investor can borrow or lend money from the market given in decimal format (i.e. 1 percent = 0.01). Recall, that the CAPM assumes that the investor can borrow or lend cash at some prevailing market rate. Though in practice the lending and borrowing costs in general will differ, for large market players such as investment banks these two rates will be approximately the same and be approximately equal to the overnight rate offered between investment banks (i.e. LIBOR or similar). Smaller players can also obtain similar lending and borrow rates through the use of structured products such as REPOs and similar, offered by investments banks. Therefore, for most market participants this assumption is reasonable and does not lead to significant errors. Please note, that this rate refers to the rate the investor will receive on any cash held within the portfolio as well as the rate at which they are able to borrow cash from the market.
Returns:
The weighting of the Market Portfolio within a portfolio on the CML with a given expected return. The weighting of the Market Portfolio is the factor of the base capital which is invested within the Market Portfolio within the portfolio selected from the CML. Note that since the portfolio can borrow money from the market this weighting can be greater than 1.
CapitalMarketDemoException
See Also:
riskCML - allow the risk of a portfolio on the CML to be evaluated when the expected return of the portfolio is known.
, returnCML - allow the expected return of a portfolio on the CML to be evaluated when the total risk of the portfolio is known.
, weight2Risk - allows the risk of a portfolio on the CML to be evaluated when the weight of the Market Portfolio within the CML portfolio is known., CapitalMarket.weightCML(double, double, double)

returnCML

public double returnCML(double risk,
                        double equityRisk,
                        double equityExpected,
                        double marketRate)
                 throws CapitalMarketDemoException
Method returnCML(double, double, double, double) as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

Find the corresponding value of the expected return of the portfolio on the Capital Market Line (CML) when the total risk is known.

Further Explanation

In order to evaluate the expected return total we are required to provide the total risk of the portfolio on the CML, the total risk and expected return of the Market Portfolio and the prevailing market rate at which cash can be borrowed or lent to the market. The market rate at which cash can by borrow or lend should be known but the expected return and the total risk of the Market Portfolio should be evaluated using marketPortfolioExpectedReturn and marketPortfolioRisk respectively. In order to evaluate these constants you will need to construct the Market Portfolio itself by using marketPortfolio, which in turn depends firstly the asset weights constraints (if applicable) being set using setConstraints before the Efficient Frontier is constructed using calculateEfficientFrontier.

Completeness of the Methods: returnCML, weightCML, riskCML, weight2Risk

The portfolio on the CML can be selected from knowledge of its total risk, expected return or weight of the Market Portfolio. Then using the above mentioned methods we are able to evaluate the other quantities which are not given. For example, if the expected return of the portfolio is known then the weight of the market portfolio can be evaluated using weightCML and the risk can be evaluated using riskCML. If on the other hand the total risk of the portfolio is known then the corresponding expected return of the portfolio can be evaluated by returnCML, and then using this deduced value we are able to evaluated the weight of the Market Portfolio using weightCML. For completeness we include the method weight2Risk which evaluates the risk of a portfolio on the CML when the weighting of the Market Portfolio within the CML portfolio is known. From knowledge of the risk of the CML portfolio we able to evaluate the corresponding value of the expected return using the method returnCML.

Therefore, using the three `...CML' methods along with `weight2Risk', which one of: total risk, expected return or weight of Market Portfolio, is used in order to selected the portfolio from the CML we are able to deduce the other two quantitative properties.

Remarks on time units and the percentage notation convention used

Within the application of this method you are required to provide a number of of parameters which are quoted within respect to a given period of time, such as `per year', `per month' and so on. Within the application of this method it is important to point out that the time unit used for each of these parameters should correspond. For instance the risk of the desired portfolio, risk of the Market Portfolio, expected return of the Market Portfolio and the market rate at which money can be lent or borrowed which are each given in decimal format (i.e. 1 percent = 0.01) should be given with respect to the same unit of time. Moreover, the returned value of the expected return of the portfolio on the CML will also be expressed with respect to the same unit of time and in decimal format (i.e. 1 percent = 0.01).

Parameters:
risk - the total risk in decimal format (i.e. 1 percent = 0.01) of the portfolio on the CML for which the expected return is being evaluate.
equityRisk - the risk given in decimal format (i.e. 1 percent = 0.01) of the market portfolio which can be evaluated using the method marketPortfolioRisk.
equityExpected - the expected return from the Market Portfolio given in decimal format (i.e. 1 percent = 0.01). The expected return of the Market Portfolio can be evaluated using the method marketPortfolioExpectedReturn.
marketRate - the fixed rate at which the investor can borrow or lend money from the market given in decimal format (i.e. 1 percent = 0.01). Recall, that the CAPM assumes that the investor can borrow or lend cash at some prevailing market rate. Though in practice the lending and borrowing costs in general will differ, for large market players such as investment banks these two rates will be approximately the same and be approximately equal to the overnight rate offered between investment banks (i.e. LIBOR or similar). Smaller players can also obtain similar lending and borrow rates through the use of structured products such as REPOs and similar, offered by investments banks. Therefore, for most market participants this assumption is reasonable and does not lead to significant errors. Please note, that this rate refers to the rate the investor will receive on any cash held within the portfolio as well as the rate at which they are able to borrow cash from the market.
Returns:
Expected return of a portfolio on the CML which has a given total risk.
CapitalMarketDemoException
See Also:
riskCML - allow the risk of a portfolio on the CML to be evaluated when the expected return of the portfolio is known.
, weightCML - allows the Market Portfolios weight to be evaluated for a portfolio on the CML with a given expected return.
, weight2Risk - allows the risk of a portfolio on the CML to be evaluated when the weight of the Market Portfolio within the CML portfolio is known., CapitalMarket.returnCML(double, double, double, double)

riskCML

public double riskCML(double expectedReturn,
                      double equityExpected,
                      double marketRate,
                      double equityRisk)
               throws CapitalMarketDemoException
Method riskCML(double, double, double, double) as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

Calculates the risk of the optimal Capital Market Line (CML) portfolio for a given expected return.

Further Explanation

In order to evaluate the total risk we are required to provide the expected return and the risk of the Market Portfolio. These properties of the Market Portfolio can be evaluated by using marketPortfolioExpectedReturn and marketPortfolioRisk respectively. In order to evaluate these constants you will need to construct the Market Portfolio itself by using marketPortfolio, which in turn depends firstly the asset weights constraints (if applicable) being set using setConstraints before the Efficient Frontier is constructed using calculateEfficientFrontier.

Remark:

Completeness of the Methods: riskCML, weightCML, returnCML, weight2Risk

The portfolio on the CML can be selected from knowledge of its total risk, expected return or weight of the Market Portfolio. Then using the above mentioned methods we are able to evaluate the other quantities which are not given. For example, if the expected return of the portfolio is known then the weight of the market portfolio can be evaluated using weightCML and the risk can be evaluated using riskCML. If on the other hand the total risk of the portfolio is known then the corresponding expected return of the portfolio can be evaluated by returnCML, and then using this deduced value we are able to evaluated the weight of the Market Portfolio using weightCML. For completeness we include the method weight2Risk which evaluates the risk of a portfolio on the CML when the weight of the Market Portfolio within the CML portfolio is known. From knowledge of the risk of the CML portfolio we able to evaluate the corresponding value of the expected return using the method returnCML.

Therefore, using the three `...CML' methods along with `weight2Risk', which one of: total risk, expected return or weight of Market Portfolio, is used in order to selected the portfolio from the CML we are able to deduce the other two quantitative properties.

Remarks on time units and the percentage convention used

Within the application of this method you are required to provide a number of of parameters which are quoted within respect to a given period of time, such as `per year', `per month' and so on. Within the application of this method it is important to point out that the time unit used for each of these parameters should correspond. For instance the expected return of the desired portfolio, expected return of the Market Portfolio, the market rate at which money can be lent or borrowed and the risk of the Market Portfolio which are each given in decimal format (i.e. 1 percent = 0.01) should be given with respect to the same unit of time. Moreover, the returned value of the total risk of the portfolio on the CML will also be expressed with respect to the same unit of time and in decimal format (i.e. 1 percent = 0.01).

Parameters:
expectedReturn - the expected return of the portfolio on the CML for which the risk is evaluated given in decimal format (i.e. 1 percent = 0.01)
equityExpected - the expected return from the Market Portfolio given in decimal format (i.e. 1 percent = 0.01). The expected return of the Market Portfolio can be evaluated using the method marketPortfolioExpectedReturn.
marketRate - the fixed rate at which the investor can borrow or lend money from the market given in decimal format (i.e. 1 percent = 0.01)
equityRisk - the risk given in decimal format (i.e. 1 percent = 0.01) of the market portfolio which can be evaluated using the method marketPortfolioRisk.
Returns:
The total risk in decimal format (i.e. 1 percent = 0.01) of the portfolio on the CML which has a given expected return.
CapitalMarketDemoException
See Also:
weightCML - allows the Market Portfolios weight to be evaluated for a portfolio on the CML with a given expected return.
, returnCML - allows the expected return of a portfolio on the CML to be evaluated when the total risk of the portfolio is known.
, weight2Risk - allows the risk of a portfolio on the CML to be evaluated when the weight of the Market Portfolio within the CML portfolio is known., CapitalMarket.riskCML(double, double, double, double)

weight2Risk

public double weight2Risk(double weighting,
                          double equityRisk)
                   throws CapitalMarketDemoException
Method weight2Risk(double, double) as defined in the CapitalMarket remote interface.

Description copied from the CapitalMarket interface:

Evaluates the total risk of a portfolio on the CML when the weighting of the Market Portfolio within the portfolio selected for the CML is known.

Further Explanation

Note that we are required to provide the risk of the Market Portfolio within the application of this method. This constant can be evaluated by using marketPortfolioRisk, which in turn requires that the Market Portfolios asset weights are known. The weights of the assets within the Market Portfolio can be evaluated using the marketPortfolio. The evaluation of these (possibly constrained) weights requires that the Efficient Frontier has already been evaluated using calculateEfficientFrontier, before which the constraints on the asset should have been set (if applicable) using setConstraints.

Completeness of the Methods: weight2Risk, riskCML, weightCML, returnCML

The portfolio on the CML can be selected from knowledge of its total risk, expected return or weight of the Market Portfolio. Then using the above mentioned methods we are able to evaluate the other quantities which are not given. For example, if the expected return of the portfolio is known then the weight of the market portfolio can be evaluated using weightCML and the risk can be evaluated using riskCML. If on the other hand the total risk of the portfolio is known then the corresponding expected return of the portfolio can be evaluated by returnCML, and then using this deduced value we are able to evaluated the weight of the Market Portfolio using weightCML. For completeness we include the method weight2Risk which evaluates the risk of a portfolio on the CML when the weight of the Market Portfolio within the CML portfolio is known. From knowledge of the risk of the CML portfolio we able to evaluate the corresponding value of the expected return using the method returnCML.

Therefore, using the three `...CML' methods along with `weight2Risk', which one of: total risk, expected return or weight of Market Portfolio, is used in order to selected the portfolio from the CML we are able to deduce the other two quantitative properties.

Remarks on time units and the percentage convention used

Within the application of this method you are required to provide the risk in decimal format (i.e. 1 percent = 0.01) of the Market Portfolio which will be quoted within respect to a given period of time, such as `per year', `per month' and so on. Moreover, the returned value of the total risk of the portfolio on the CML will also be expressed with respect to the same unit of time and in decimal format (i.e. 1 percent = 0.01).

Remarks concerning Constraints on the level of Cash Borrowed or Lent

As mentioned in the introduction of this class often in practice a given fund will have limits regarding:

  1. Maximum level of cash which should be help within the portfolio
  2. Maximum level of borrowing (i.e. gearing) which the portfolio use
We provide further motivation concerning the rational for such limits within the PDF documentation.

Within the context of our implementation these restrictions would translate into constraints on the level of cash, that is the weighting of the Market Portfolio within the portfolio on the CML. Within the Enterprise JavaBean we are able to deal with such constraints of the level of cash borrow or lent from/to the market. In particular, within such instances we are able to evaluated the corresponding optimal portfolio's expected return, risk and Market Portfolio Weighting for the following schema:

  1. Express in terms of Weightings: Translated the restrictions on the borrow and lending into statements concerning the maximum and minimum weighting and the Market Portfolio.
  2. Evaluate the range of Total Risk: Evaluate the corresponding range of the Total Risk of the range of portfolios on the CML which have the given range of Market Portfolio weightings found in the previous step. We are able to evaluate this range by apply this method and observing that the Total Risk is monotonically increasing in risk as the Market Portfolio weighting increases.
  3. Evaluate the range of the Expected Return: Evaluate the corresponding range of the expected returns of the range of portfolios on the CML which have given range of Market Portfolio weightings. Since (by the previous step) the portfolios with a range of Market Portfolio Weightings corresponds to the collection of portfolios on the CML for a given range of the total risk, and the fact that the expected return increase monotonically as the total risk increase by using returnCML we are able to evaluate the range of expected returns which determines the portfolios with given constraints on the cash levels within the portfolio.

Remark: The key reason why this approach works is that if the weighting of the Market Portfolio increases continuously monotonically increases, the corresponding total risk and expected returns of the portfolio also continuously monotonically increases.

The only thing that needs to be established is how we can translate statements concerning the limits on borrowing and lending, and statements concerning the weighting of the market portfolio. We will illustrate how this is done by the following example:

Example: We know that the Market Portfolio of a collection of assets has an expected return of 10 percent per year and a risk of 20 percent per year. According to the CAPM if the portfolio manager can only leverage his portfolio by 20 percent, and must also never hold more than 30 percent of the funds capital in cash then what is the range of total risk and expected return of the (optimal) portfolios which the fund manager can hold?

Solution: Since the optimal portfolio will consist of the Market Portfolio with either excess money lent to the market or money borrowed from the market in order to purchase more baskets of the Market Portfolio. The optimal portfolios will can be constructed will range from borrowing 20 percent of the capital base and purchasing further baskets of the Market Portfolio, to lending 30 percent of the capital base and holding the remaining 70 percent of the capital base within the Market Portfolio. Therefore, the Weighting of the Market Portfolio can range from 1.2 (maximum gearing) to 0.7 (maximum lending). This completes step 1, in the above schema to evaluate range of the risk and expected return we just perform step 2 and 3, as describe above.

Note: We implement this exact instance as an examples called CapitalMarketClient_CashConstraints.

Parameters:
weighting - the weighting of the Market Portfolio within the CML portfolio. The weighting corresponds to the multiple of the base capital which is invested within the market portfolio. Recall that all portfolios on the CML consist of a weighting in the market portfolio which can be constructed using the method marketPortfolio and cash. The weighting in cash can be negative, that is money can be borrowed from the market in order to increase that amount of the Market Portfolio which is controlled by the underlying capital base. In this instance the weighting of the Market Portfolio will increase above 1 since more than 100 percent of the available (base) capital has been invested within the Market Portfolio.
Returns:
The total risk in decimal format (i.e. 1 percent = 0.01) of the portfolio on the CML which has a given weighting of the Market Portfolio.
CapitalMarketDemoException
See Also:
weightCML - allows the Market Portfolios weight to be evaluated for a portfolio on the CML with a given expected return.
, returnCML - allows the expected return of a portfolio on the CML to be evaluated when the total risk of the portfolio is known.
, riskCML - allow the risk of a portfolio on the CML to be evaluated when the expected return of the portfolio is known., CapitalMarket.weight2Risk(double, double)

WebCab Portfolio Demo
v4.2
(J2EE Edition)