WebCab Portfolio for .NET v5.0 Demo

CapitalMarket Class

Applies the Capital Asset Pricing Model (CAPM) to find the market portfolio and construct the Capital Market Line (CML).

For a list of all members of this type, see CapitalMarket Members.

System.Object
   CapitalMarket

public class CapitalMarket

Remarks

The Capital Asset Pricing Model (CAPM) is an extension of the Markowitz model provided within Markowitz class.

Overview

Within the CAPM an investors portfolio is constructed from a collection of risky assets, which is then either leveraged or de-leveraged with borrowings or cash deposits. Within the CAPM one assumes that the rate at which monies are lent or borrowed at the prevailing risk free rate. The ability the borrow or deposit capital reflects the real world management of portfolios where excess capital is typically lent or borrowed around LIBOR for GBP funds, or the Fed Funds rate for USD funds.

Remark: The CAPM does not take into account the credit worthiness of the leveraged portfolios. However, assuming the capital can be borrowed at the risk free rate is not unreasonable if the portfolio is not highly leveraged. Since in such instances a repo agreement would allow capital to be borrowed at close to the prevailing risk free rate.

Nature of the Capital Asset Pricing Model (CAPM)

The introduction of the risk free asset, namely cash along with the risky assets transforms the Efficient Frontier curve of the Markowitz Theory on which the optimal portfolios lie into a straight line, known as the Capital Market Line (CML). The CML consists of (optimal) portfolios which are constructed from a weighting or geared position in the Market Portfolio (explained below) with the net cash/debt balance lent or respectively borrowed from the market.

The Market Portfolio is the portfolio on the Efficient Frontier (see Markowitz class or the PDF documentation for more details) which offers the greatest return over the risk free rate per unit of risk. That is, the portfolio on the Efficient Frontier which maximizes:

(Expected Return - Risk Free Rate) / Total Risk

The Market Portfolio purchased with cash or debt represents the cheapest means in terms of risk to increase the return of the portfolio above the risk free rate. The weighting of the Market Portfolio (and cash/debt) will depend on the level of expected return required. In particular, the portfolios on the Capital Market Line (CML) will fall into the following cases:

  1. Borrow money at the prevailing market rate in order to take of geared position in the Market Portfolio. In this case the investors portfolio will have an expected return greater than the Market Portfolio, and a risk level higher than the Market Portfolio.
  2. Lend Money at the prevailing market rate with a weighting in the Market Portfolio of less than 100 per cent. In this case the investors portfolio will have an expected return less than the Market Portfolio, and a risk level less than the Market Portfolio.
  3. No cash holdings or borrowing if the expected return (or risk) you require is the same as the expected return (or risk) of the Market Portfolio.

Brief Overview of the Functionality Offered

As described above the introduction of a risk free asset within the Capital Market Theory transforms the Efficient Frontier into the Capital Market Line (CML) which as the name suggests is a straight line when plotted within the risk vs expected return plane. Portfolios correspond to points on the CML consist of multiples of a basket of assets known as the Market Portfolio and a positive or negative cash balance which is either borrowed from or lend at the risk free interest rate. This class enables the construction of the Market Portfolio from which the corresponding Capital Market Line (CML) will be derived.

The steps required to construct the CML, from which the optimal portfolio with respect to the CAPM can be found, will almost always proceed along the following lines:

  1. Evaluate (possibly constrained) Efficient Frontier using SetConstraints, SetAssetWeightsInequalityConstraints and SetAssetWeightsEqualityConstraints (if applicable), and then CalculateEfficientFrontier.
  2. Construct Market Portfolio using MarketPortfolio, and evaluate its expected return and risk using MarketPortfolioExpectedReturn, MarketPortfolioRisk respectively.
  3. Evaluate the weight of the Market Portfolio and hence the weight of the cash component within the (optimal) portfolio on the CML for a given expected return using the method WeightCML. Note that the risk of the (optimal) portfolio can be evaluated using riskCML when the expected return is given, and using weight2Risk when the weight of the market portfolio is given.

Remark: For a given set of assets with possibly constrained asset weights there will correspond a range of values of the expected return over which the (constrained) Efficient Frontier exists and in which the Market Portfolio will lie. You are able to evaluate this continuous range by applying the methods MinFrontierReturn and MaxFrontierReturn, which evaluate the upper and lower bounds respectively of the expected return over which the Efficient Frontier exists. If you are considering the constrained case then the constraints should be set (by calling SetConstraints) before the range of the expected returns are evaluated.

Detailed Overview of the Functionality Offered

The application of the CAPM will consist of performing the following three steps:

  1. Construction of the Efficient Frontier
  2. Evaluation of the Market Portfolio
  3. Selecting a Portfolio from the CML

1) Construction of the Efficient Frontier

In order to construct the Market Portfolio it is necessary to evaluate the (possibly constrained) Efficient Frontier which consists of optimal portfolios of risky assets. The (possibly constrained) Efficient Frontier is constructed by the following two steps:

  1. Set Constraints on Asset Weights - Constraints can be placed on the weights of the assets of the portfolios which make up the Efficient Frontier by calling the following methods:
  2. Construct the Efficient Frontier - Evaluates the Efficient Frontier at a finite number of points by calling one of the following methods:

Remarks:

2) Evaluation of the Market Portfolio

The Efficient Frontier is the collection of portfolios constructed from the given set of available assets which exhibit the lowest risk for a given value of the expected return. Note that the weights of the assets from which the portfolios are constructed may be required to satisfy linearly constraints.

The linear constraints must be set using SetConstraints, SetAssetWeightsInequalityConstraints and SetAssetWeightsEqualityConstraints, before the Efficient Frontier is constructed using CalculateEfficientFrontier(double[][],...), or (double, double, double[][], double[], int, double) calculateEfficientFrontier(double,...).

Once the Efficient Frontier has been constructed, the next step is to find the Market Portfolio. The Market Portfolio is the (unique) portfolio on the Efficient Frontier which maximizes:

(Expected Return of Portfolio - Risk Free Rate) / Total Risk of Portfolio

The Market Portfolio is selected from the Efficient Frontier by calling one of the following methods:

  1. (double[][], double[], double) marketPortfolio(double[][], double[], double) - Finds the Market portfolio by search over the entre range of the Efficient Frontier.
  2. (double, double, double[][], double) marketPortfolio(double, double, double[][], double) - Finds the Market Portfolio by searching over a range of the expected return in which it is known to exist. The procedure is more efficient than (double[][], double[], double) marketPortfolio(double[][],..), when the range over which the Market Portfolio lies is known.

Each of these methods returns an array containing the (possibly constrained) weights of the Market Portfolio.

3) Selecting a Portfolio on the CML

The Capital Market Line (CML) is the collection of portfolios which are constructed by either deleveraging and gearing the Market Portfolio by lending or borrowing (risk free) cash at the prevailing market rate. These portfolios in accordance with the CAPM offer the lowest risk for a given level of the expected return.

A portfolio on the CML can be selectecd from any one of the following criteria:

  1. Expected Return of the Portfolio of the CML: Given expected return of portfolio on CML, WeightCML returns the Market Portfolio Weighting, from which the portfolio risk can be evaluated using Weight2Risk.
  2. Total Risk of the Portfolio on the CML: Given the risk of the Portfolio on the CML, ReturnCML returns the portfolios expected return.
  3. Weighting of the Market Portfolio within the Portfolio on the CML: Given the weight of the Market Portfolio the risk can be found using Weight2Risk, from which the expected return can be found using ReturnCML.

Therefore, given any one of the above properties (total risk, expected return and Market Portfolio weighting) the other two properties can be deduced. Hence the methods RiskCML, WeightCML, ReturnCML, and Weight2Risk are complete.

Constraints on the level of Cash Holdings and/or Borrowings with a Portfolio

In practice (as detiled within the PDF documentation) a given fund will often have limits regarding:

  1. Maximum level of cash which should be held within the portfolio.
  2. Maximum level of borrowing (i.e. gearing) which the portfolio can use.

Such constraints on the level of cash or borrowings, imply constraints on the weighting of the Market Portfolio within the portfolio on the CML. By applying Weight2Risk one is able to evaluate the range of the total risk of the portfolio on the CML which satisfies these constraints. From which the range of the expected returns can be found using ReturnCML.

Using Absolute or Relative Historical Values

Within the application of the CAPM you should decuide from the beginning whether to use absolute or relative values for the historical values and expected returns. In particular, the values of the expected return which are either evaluated or given will be or will need to be in accordance with the units used within the historical values. That is:

  1. Historical Values: Source data which is given in absolute or relative (percentage) terms.
  2. Expected Returns: The expected return of the investment over the period considered should be given in the units (i.e. absolute or relative) in which you wish the result to be returned. That is, if absolute values are given then the result will be returned as an absolute value and if relative value are given then the result will be returned as a relative value.

The units used within these two quantities will determine the units used within the construction of the Efficient Frontier and Market Portfolio.

Assumptions of the Capital Asset Pricing Model (CAPM)

The CAPM makes all the assumptions of the Markowitz models concerning the (investment) market and investors behavior, namely that:

  1. Investors seek to maximize the expected return on total wealth.
  2. All investors have the same expected single period investment horizon.
  3. All investors are risk-adverse, and hence will only accept greater risk if they are compensated with a higher expected return.
  4. All markets are perfectly efficient (e.g. no taxes and no transaction costs).

The CAPM in addition to these assumptions also makes the following provisions:

  1. Lend excess capital at the Market Rate: The investor may lend money at the prevailing market rate. This constitutes the ability to hold within the portfolio a risk free asset which will provide the prevailing return available on cash. In practice, such assets are often referred to as money market accounts which yield a return in the region of LIBOR (London Interbank Overnight Rate).
  2. Borrow capital at the Market Rate: The investor may borrow money from the market at the prevailing market rate in order to invest within (risky) assets. This will increase the expected return of the original capital base and also increase its risk. In practice, the rate at which money can be lent from the market by a fund will be in the region of LIBOR (at least if the fund structures the loan as a REPO type agreement).

Note that the rate of which money can be borrowed or lend from or to the market within the CAPM is assummed to be the same.

Summary of Functionality provided

With this class we offer the following functionality:

Estimation/evaluation of non-observable parameters

A number of the parameters which are required by the main methods of this class (such as the covariance matrix) are not directly observable from the market. However, the evaluation may be evaluated or estimated directly from market driven information such as historical asset prices. All methods related to the evaluation of such parameters have been collected within the AssetParameters class.

In particular, the AssetParameters class contains the following procedures:

  1. Evaluation of the Covariance Matrix - CovarianceMatrix, CovarianceMatrix
  2. Estimation of the Expected Return - ExpectedReturns, ExpectedReturns
  3. Estimation of the Volatility - Not directly used within this class but its estimated value can act of a reference point when judging the effects of diversification.

Requirements

Namespace: WebCab.Libraries.Finance.Portfolio

Assembly: WebCab.Libraries.PortfolioDemo (in WebCab.Libraries.PortfolioDemo.dll)

See Also

CapitalMarket Members | WebCab.Libraries.Finance.Portfolio Namespace