• Tidak ada hasil yang ditemukan

USER-DEFINED FUNCTIONS IN Module1

SOLUTION NOTES FOR EXERCISES ON FUNCTIONS

4. Code for Standard Deviation of Cash Flows

7.8 USER-DEFINED FUNCTIONS IN Module1

Many of the functions in this module involve straightforward transfers of the formulas from the spreadsheets into VBA. This is true of the ISHorizonWealth function and all the functions whose names start with Portfolio. There are two useful func- tions CorrMatrix and VCVMatrix for calculating the correlation matrix and the vari- ance–covariance matrix, the only input being a matrix of returns data (retsmat). Both functions systematically select two columns of the returns matrix, apply Excel func- tions (CORREL and COVAR here) to calculate the measures, then store the result in the output matrix.

Asset Pricing 137 One further point about the VCVMatrix code should be mentioned here. When calcu- lating the VCV matrix we use sample measures (such as the VAR function) rather than population measures (such as the VARP function). Rather confusingly, the COVAR func- tion in Excel is a population measure and so must be multiplied byn/n1to get the sample measure.

The most ingenious function in the module is the function that returns the single- index VCV matrix. It has two inputs: the matrix of returns (retsmat) and the market returns vector (mktvec). The code for this is given in full below. Notice the declaration of variables such as rvec() as arrays whose dimensions are later set in ReDim statements when the size of the input matrix has been determined.

Function VCVSingleIndexMatrix(retsmat, mktvec)

’ returns nxn sample single-index variance-covariance matrix

’ uses PortfolioBeta fn

’ uses PortfolioSpecificRisk fn Dim vmkt, bi, sri

Dim i As Integer, j As Integer, nc As Integer, nr As Integer

Dim rvec() As Variant, bvec() As Variant, srvec() As Variant, Vcvmat() As Variant nc = retsmat.Columns.Count

ReDim Vcvmat(nc, nc) ReDim bvec(nc) ReDim srvec(nc) nr = retsmat.Rows.Count ReDim rvec(nr)

’ first calculate the inputs (betas, specific risks and market variance) For j = 1 To nc

For i = 1 To nr rvec(i) = retsmat(i, j) Next i

bvec(j) = PortfolioBeta(rvec, mktvec)

srvec(j) = PortfolioSpecificRisk(rvec, mktvec, 1) Next j

vmkt = Application.Var(mktvec)

’ then cycle through vcv matrix For i = 1 To nc

bi = bvec(i) sri = srvec(i) For j = i To nc

If j = i Then

Vcvmat(i, j) = (biO2)Łvmkt + (sriO2) Else

Vcvmat(i, j) = biŁbvec(j)Łvmkt Vcvmat(j, i) = Vcvmat(i, j) End If

Next j Next i

VCVSingleIndexMatrix = Vcvmat End Function

In the first If. . . Then loop where j refers to the jth asset and i to the ith return, the beta and specific risk are evaluated for each asset using other user-defined functions. The second If. . .Then loop inserts the variance and covariance expressions based on the betas and specific risks into the appropriate slot in the VCV matrix.

SUMMARY

The contribution of the single-index model is to divide the view of risk from the previous chapter into two: one part that comes from the influence of the index or market portfolio and a second part that is specific to individual shares or assets. We apply the single-index model to facilitate the estimation of variance–covariance matrices as well as to provide beta coefficients through regression. As always, we show the calculations, here involving regression and matrix multiplication, both in the spreadsheet and in user-defined functions.

The near similarity of the algebra underlying the single-index model and the capital asset pricing model should not prevent us from appreciating just how big a step the development of the CAPM was. In its most literal form, the CAPM says that only market-related risk is rewarded.

Although the CAPM can be developed from individual utility and the generic portfolio problems in the previous chapter, it is more straightforward to focus on the equivalent assumption that log returns on shares follow a normal distribution. We use this assumption of normality to illustrate how to forecast the distribution of future wealth from past returns and also to illustrate the calculation of Value-at-Risk.

In the next chapter, we look at the performance measurement of active investment strategies using both single-index and multi-index passive benchmarks.

REFERENCES

Bodie, Z., A. Kane and A. J. Marcus, 1996,Investments, 3rd edition, Richard D. Irwin, Englewood Cliffs, NJ.

8

Performance Measurement and Attribution

The broad objective of performance measurement is to assess and compare the perfor- mance (past returns) of different investment strategies. Our main emphasis in this chapter will be on the choice between passive and active investment strategies when assembling a portfolio of risky assets. The secondary emphasis will be on choosing the level of risk-free assets to complement the chosen risky portfolio.

Under a pure passive investment strategy, an investor holds a portfolio that is an exact copy (by component shares and weights) of the market index. The passive investor does not rely on superior information and, apart from rebalancing when the constituents of the index change, there is no trading. The passive investor is rewarded for bearing market risk and will achieve the market return less the unavoidable trading costs.

In contrast, under an active investment strategy the investor’s portfolio differs from the market index by having different weights in some or all of the shares in the market index.

The active investor relies on having superior information and is prepared to incur much greater trading costs than the passive investor. In practice, only a few active investors outperform the returns from passive investment in the long term, since they bear specific risk and incur greater trading costs. With the increasing complexity of active strategies, the need for more sophisticated benchmarks and performance measurement is becoming ever more vital.

This chapter reviews the earliest ideas about performance measurement from the 1960s as well as the very latest ideas in performance attribution from the 1990s. All the approaches use asset returns, which is advantageous because this data is readily avail- able for individual equities and investment funds. Conventional performance measurement was developed at the same time as the theories on asset pricing described in the previous chapter. Hence the Sharpe ratio uses as a return ‘benchmark’ the return on the risk-free asset, whereas the other three measures use a CAPM (single-index) benchmark. Another approach from the seventies, the Treynor–Black ‘active–passive’ model (Treynor and Black, 1973), blends an active portfolio of shares viewed as mispriced with a passive index portfolio to create an optimal risky portfolio. This approach builds on the so-called generic portfolio problems discussed in Chapter 6. Portfolio performance assessment and the Treynor–Black model are both discussed in Bodie et al. (1996), Chapter 24. However, the most recent technique of performance attribution, called style analysis, is not covered in Bodie et al. Style analysis was developed by Sharpe (1992) and uses a multi-index model as the return benchmark.

The four conventional performance measures involve the ratio of the fund’s return relative to a return benchmark divided by a chosen measure of risk (such as volatility, beta or residual risk). The measures are illustrated in the spreadsheets of EQUITY3.xls and have also been developed as user-defined functions. Similarly, the spreadsheet imple- mentation of the Treynor–Black ‘active–passive’ model uses functions, in this case the user-defined functions already developed for the generic portfolio problems. Style anal- ysis, like the task of finding the constrained efficient frontier, uses Excel’s Solver to carry out quadratic programming. It has two extensions: obtaining confidence intervals for the

style weights (here also implemented using Solver) and exposure analysis, a rolling-period style analysis which shows how a fund’s style changes over time. Since many repetitions of style analysis are required, exposure analysis is best implemented in Excel macros.