WebCab Portfolio for .NET v5.0 Demo

Markowitz.SetConstraints Method 

Here we allow constraints to be placed on the weights of the assets from which the portfolios within the Efficient Frontier will be constructed.

public void SetConstraints(
   double[] lowerBounds,
   double[] upperBounds
);

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.

Remarks

All methods which depend on the construction of the Efficient Frontier, are effected by imposing constraints on the assets weights of the portfolios on the Efficient Frontier.

Methods effected by the setting of constraints on the Asset Weights

The methods within this class which are effected and how they are effected by the setting of constraints on the weights of the assets from which the portfolios are constructed is given below:

  1. CalculateEfficientFrontier - Each portfolio on the Efficient Frontier must satisfy the constraints on the assets.
  2. GetEfficientFrontierExpectedReturns - Reads the expected returns of the evaluated constrained portfolios on the constrained Efficient Frontier.
  3. GetEfficientFrontierAssetWeights - Reads the asset weights of the evaluated constrained portfolios on the constrained Efficient Frontier.
  4. GetEfficientFrontierPortfolioRisks - Reads the portfolios risk of the evaluated constrained portfolios on the constrained Efficient Frontier.
  5. GetPointsOnEfficientFrontier - Reads the portfolios risk, weights and expected returns of the evaluated (constrained) portfolios on the (constrained) Efficient Frontier.
  6. EfficientFrontier - Returned the constrained portfolio which a given expected return on the constrained Efficient Frontier.
  7. EfficientFrontier - Returns the weights of the constrained asset of a portfolio on the constrained Efficient Frontier.
  8. OptimalPortfolio - Returns the set of constrained portfolios on the constrained Efficient Frontier in accordance with the investors utility function.
  9. OptimalPortfolioMaxExpected - Returned the constrained portfolio with the maximum expected return of the portfolio which where selected in accordance with the investors utility function.

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 the same number of terms of the number of assets.

Constraints have Default Values

If the constraints are not set then they will 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, and MinFrontierReturn 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 and MinFrontierReturnWeights, 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.

See Also

Markowitz Class | WebCab.Libraries.Finance.Portfolio Namespace