Академический Документы
Профессиональный Документы
Культура Документы
INDEX
6. The Alpha from the Fama and French three factors model.
file
In this practice you will use a sample of Equity Mutual Funds from one of the most
prestigious mutual fund database, the CRSP (Chicago Research Security Prices). In this
database there are data from 1960 until 2006, and for all mutual fund categories (equity,
fixed income, balanced, etc). However, given that this is only an exercise you will use
data from 55 Equity mutual funds in the Aggressive Growth Category and from January
2002 until December 2004. The frequency of the data will be monthly (24 observations
for each fund). All this data are in a matlab file name DATAFUNDS.mat
Moreover, you will need some other additional data, as Treasure Bills returns, Market
returns, or the Fama and French factors. And these additional data are in a file named
ADDITIONAL_DATA.mat.
Second, write some comments at the beginning that permits you to identify
this code.
>> %% This code has been created to evaluate Equity Mutual Funds - Mater in Finance
>> %% Date: February-2012
rMF: This contains the returns of all mutual funds. Each mutual fund is
represented in a different column. So rMF is a 24 x 55 matrix.
rtbills: It is a vector (24x1) with the monthly risk-free rate.
rMk: It contains the returns of a Market index.
smb: A column vector with the Small-minus-Big factor to be use in the Fama
and Frech model.
hml: A column vector with the High-minus-Low factor for the Fama and French
model.
wml: A column vector with the momentum factor for the Carhart model.
If you want, you could plot each of the variables to check that they are right or there are
not extreme outliers, etc.
>> plot(rtbills)
>> plot(rMk)
>> plot(SMB)
>> plot(HML)
window.
If you want to save only one variable in Excel (may be to do another operations with it),
the command will be
First, we compute the average return obtained by each mutual fund, and we
can do it with the function mean.
>>meanrMF=mean(rMF);
Remember that the function "mean" is computing the average or mean for each column in the
matrix. When you have the returns of the mutual funds in rows instead of in columns, you have
to transpose the data [mean(rMF')]
Third, we compute the standard deviation of each mutual funds, using the
function std.
>> stdrMF=std(rMF);
It is must be noted that you are using ./ and not /. Because actually you do not want
to do a matrix division. Instead you need to divide each mutual fund excess return by its
standard deviation.
Additionally, you could compute the Average Sharpe Ratio (or the median) for all the
mutual funds, or plot the Sharpe Ratios to analyze them.
>> figure
>> bar(Sharpe)
0.4
0.3
0.2
0.1
-0.1
-0.2
0 10 20 30 40 50 60
In this ratio we can use some of the variables computed in the previous
performance measure. Because the numerator is equal than in the Sharpe
ratio, we only need to compute the beta (denominator of Treynor Ratio).
>> rMF2(:,j)=rMF(:,j)-rtbills;
>> rMk2=rMk-rtbills;
>> varianrMk2=var(rMk2);
>> covarMatrix=cov(rMF2(:,j),rMk2);
>> covarMF=covarMatrix(1,2);
>> Beta(1,j)=covarMF/varianrMk2;
>> end
0.025
0.02
0.015
0.01
0.005
-0.005
-0.01
0 10 20 30 40 50 60
ri = i + i (rM ) +
where
ri = Ri r f
rM = RM r f
[B, BINT]=regress(Y,X)
[STATS]=regstats(Y,X, 'linear')
Name Meaning
'Q' Q from the QR Decomposition of the design matrix
'R' R from the QR Decomposition of the design matrix
'beta' Regression coefficients
'covb' Covariance of regression coefficients
'yhat' Fitted values of the response data
'r' Residuals
'mse' Mean squared error
'rsquare' R-square statistic
'adjrsquare' Adjusted R-square statistic
'leverage' Leverage
'hatmat' Hat (projection) matrix
's2_i' Delete-1 variance
'beta_i' Delete-1 coefficients
'standres' Standardized residuals
'studres' Studentized residuals
'dfbetas' Scaled change in regression coefficients
'dffit' Change in fitted values
'dffits' Scaled change in fitted values
'covratio' Change in covariance
'cookd' Cook's distance
'tstat' t statistics for coefficients
'fstat' F statistic
'dwstat' Durbin Watson statistic
'all' Create all of the above statistics
>> bar(alpha_J)
Remember that you can introduce titles with the command "title', and the text in the
axes with the commands "xlabel", "ylabel"
>> hist(alpha_J)
>> meanAlpha=mean(alpha_J);
0.015
0.01
alpha
0.005
-0.005
-0.01
0 10 20 30 40 50 60
number of mutual fund
10
0
-0.01 -0.005 0 0.005 0.01 0.015 0.02
[stats]=regstats(Y,X,'linear')
>> bar(alphaFF)
>> hist(alphaFF)
>> meanAlphaFF=mean(alphaFF);
0.005
-0.005
alpha FF
-0.01
-0.015
-0.02
-0.025
0 10 20 30 40 50 60
number of mutual fund
12
10
0
-0.025 -0.02 -0.015 -0.01 -0.005 0 0.005 0.01
Third, we can analyze the differences between using Jensens Alpha and
Alpha from the FF three factors model.
>> Diff_alpha=alpha-alphaFF
>> figure
>> plot(Diff_alpha,s-r)
>> title(Difference among Alphas), grid on
0.01
0.005
-0.005
-0.01
0 10 20 30 40 50 60
First, we can sort the mutual funds with the function sort.
You must note that in SharpeRank variable you have the Sharpe Ratio values for each
mutual fund ranked by Sharpe Ratio. But in the variable SharpeRank2 you have the
number (from colums in rMF) of the mutual fund in that position.
Now, we can built a new matrix with the index of each funds in the
rankings computed previously.
TableRank =
25 25 25 25
The worst fund
7 7 24 49
24 24 7 50
27 17 27 52
17 27 19 38
19 49 49 37
>> subplot(2,2,1)
>> bar(Sharpe)
>> subplot(2,2,2)
>> bar(Treynor)....
>> .....
Sharpe Treynor
0.6 0.03
0.4 0.02
0.2 0.01
0 0
-0.2 -0.01
0 20 40 60 0 20 40 60
alpha alphaFF
0.02 0.01
0
0.01
-0.01
0
-0.02
-0.01 -0.03
0 20 40 60 0 20 40 60