.chapter18<-function(i=0){
" i Chapter 18: Multivariate, FF3, FFC4, FF5 etc.
- -------------------------------------
1 CAPM is a single-factor linear model
2 linear vs. none-linear
3 A General multi-factor linear model
4 FF3: Fama-French 3-factor model
5 How to cut 6 portfolios
6 SMB vs. HML (how they are constructed)
7 Manually get FF monthly or daily factors time series
8 An efficient way to get FF factors
9 Momentum
10 FFC4 factor model: Fama-French-Carhart 4-factor model
11 Manually get momentum factor
12 An efficient way to get data
13 FF5: Fama-French 5-factor model
14 Manually get FF5 time series
15 An efficient way to get the data
16 Order of data sets (in terms of date)
17 Merge data sets
18 How to run a Fama-Frech 3 factor model?
19 How to interpret the result?
20 Links
Example #1:>.c18 # find out the above list
Example #2:>.c18() # the same as the above
Example #3:>.c18(1) # find the 1st explanation
";.zchapter18(i)}
.n18chapter<-20
.zchapter18<-function(i){
if(i==0){
print(.c18)
}else{
.printEachQ(18,i,.n18chapter)
}
}
.c18<-.chapter18
.C18EXPLAIN1<-"CAPM is a single-factor linear model
///////////////////////////////
Noe-factor linear model has the following form:
y= alpha + beta *x
where y is the dependent variable
x is the independent variable
alpha is the intercept
beta is the slope
We try to use x to explain y
1-factor: since we have just one independent variable
linear : a) if we draw a graph based on y and x,
it is a straight line
b) the power of the independent variable, i.e.,
x is one.
///////////////////////////////
"
.C18EXPLAIN2<-"linear vs. none-linear
///////////////////////////////
The power of independent variable is one.
y= alpha + beta*x
None linear models:
y=alpha + beta*sqrt(x)
y=alpha + beta*x^2
///////////////////////////////
"
.C18EXPLAIN3<-"A generate multi-factor linear model
///////////////////////////////
A general n-factor model
y = alpha + beta1*x1 + ... + betan*xn
y is the dependent variable
alpha is the intercept
beta1 is the coefficient of the first independent variable of x1
x1 is the first independent variable
.... ...........................
betan is the coefficient of the last independent variable of x1
xn is the last independent variable
n is the number of independent variables
///////////////////////////////
"
.C18EXPLAIN4<-"FF3: Fama-French 3-factor model
///////////////////////////////
A general 3-factor model
y = alpha + beta1*x1 + beta2*x2 + beta3*x3
R(i = Rf + beta1*(Rm-Rf) + beta2*SMB + beta3*HML
where R(i) is stock i's return
Rm-Rf is the market risk premium
SMB is the portfolio returns of small stocks minus
the portfolio returns of big stocks
HML is the portfolio returns of stocks with
high book-to-market ratio minus the portfolio returns of with
low book-to-market ratio
///////////////////////////////
"
.C18EXPLAIN5<-"How to cut 6 portfolios
///////////////////////////////
Step 1: based on size
We cut all stocks into small group and big groups
small stocks big stocks
|------------------|----------------|
Step 2: for each above group, we cut them into 3
subgroup based on Book/market ratio
book value of equity
Book/market ratio= --------------------
market value of equity
Note: that the market value of equity is its market
capitalization which is defined as the number of
shares outstanding times its price
Now, we have the following 6 portfolios
B/M
-------------------------------------
L M H
------------|-----------|------------|
stock S SL SM SH
size ------------|-----------|------------|
B BL BM BH
------------|-----------|------------|
///////////////////////////////
"
.C18EXPLAIN6<-"SMB vs. HML
///////////////////////////////
The Fama/French factors are constructed using the 6 value-weight
portfolios formed on size and book-to-market. (See the description
of the 6 size/book-to-market portfolios.)
SMB (Small Minus Big) is the average return on the three
small portfolios minus the average return on the three big portfolios,
SMB =1/3 (Small Value + Small Neutral + Small Growth)
- 1/3 (Big Value + Big Neutral + Big Growth).
HML (High Minus Low) is the average return on the two value portfolios
minus the average return on the two growth portfolios,
HML =1/2 (Small Value + Big Value) - 1/2 (Small Growth + Big Growth).
Rm-Rf, the excess return on the market, value-weight return of all
CRSP firms incorporated in the US and listed on the NYSE, AMEX, or
NASDAQ that have a CRSP share code of 10 or 11 at the beginning of
month t, good shares and price data at the beginning of t, and good
return data for t minus the one-month Treasury bill rate (from Ibbotson Associates).
///////////////////////////////
"
.C18EXPLAIN7<-"Manually get FF monthly or daily factors time series
///////////////////////////////
Step 1: go to Prof. French's data library
http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html
Step 3: find monthly or daily data
Step 4: download
///////////////////////////////
"
.C18EXPLAIN8<-"An efficient way to get FF factors
//////////////////////////////
Just issue the following lines
>.getdata
you would find two functions called showffMonthly()
and showffDaily()
Example #`1:>.showff3Monthly()
DATE MKT_RF SMB HML RF
1 1926-07-01 0.0296 -0.023 -0.0287 0.0022
2 1926-08-01 0.0264 -0.014 0.0419 0.0025
> .showff3Monthly(-2)
DATE MKT_RF SMB HML RF
1090 2017-04-01 0.0109 0.0055 -0.0216 5e-04
1091 2017-05-01 0.0105 -0.0255 -0.0371 6e-04
Example #`2: get monthly data and save it
> x<-.show3ffMonthly(0)
> saveYan(x,\"c:/temp/ffMonthly.csv\")
[1] \"Your saved file is ==>c:/temp/ffMonthly.csv\"
///////////////////////////////
"
.C18EXPLAIN9<-"Momentum trading strategy
///////////////////////////////
Momentum trading strategy is \"Buy winner and sell losers\"
Jegadeesh and Titman (1993) find that this is a profitable
trading strategy for a short-term (from 3 months to 12 months).
The important assumption is that during such a short-term period, a winner remains
to be winner while a loser remains to be a loser.
How to define winners and losers?
First, let's assume that today is January 1990, the eveluation
and holding periods are both 6 months.
Step 1: calculate past 6-month total returns for all stocks
Step 2: sort all stocks from the highest to the lowest by
using those 6-month total returns
Step 3: choose top 10% as winners while the bottom 10% as losers
Step 4: long winners and short lowers for the next 6 months
Step 5: repeat steps 1 to 4
///////////////////////////////
"
.C18EXPLAIN10<-"FFC4 factor model: Fama-French-Carhart 4-factor model
///////////////////////////////
A general 4-factor model
y = alpha + beta1*x1 + beta2*x2 + beta3*x3 + beta4*x4
R(i) = Rf + beta1*(Rm-Rf) + beta2*SMB + beta3*HML + beta4*MOM
where R(i) is stock i's returns
Rm-Rf is the market risk premium
SMB is the portfolio returns of small stocks minus
the portfolio returns of big stocks
HML is the portfolio returns of stocks with
high book-to-market ratio minus the portfolio returns of with
low book-to-market ratio
HML is the portfolio returns of stocks with
high book-to-market ratio minus the portfolio returns of with
low book-to-market ratio
MOM is the portfolio returns of winner stocks minus
the portfolio returns of losers
///////////////////////////////
"
.C18EXPLAIN11<-"Manually get momentum factor
///////////////////////////////
Step 1: go to http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html
Step 2: using shift-f to find mom
Momentum Factor (Mom) TXT CSV Details
Momentum Factor (Mom) [Daily] TXT CSV Details
Step 3: download the data
///////////////////////////////
"
.C18EXPLAIN12<-"An efficient way to get data
///////////////////////////////
just type .getdata, see the following menu
*--------------------------------------------*
* .getdata *
*--------------------------------------------*
* .getBSannual .showff3Monthly *
* .getBSquarterly .showff3Daily *
* .getISannual .showffc4Monthly *
* .getISquarterly .showffc4Daily *
* .getCFannual .showff5Monthly *
* .getCFquarterly .showff5Daily *
*--------------------------------------------*
* >.getBSannual # find the usage *
* >.getdata # back to this menu *
* >.fm # back to the main menu *
*--------------------------------------------*
///////////////////////////////
"
.C18EXPLAIN13<-"FF5: Fama-French 5-factor model
///////////////////////////////
The Fama/French 5 factors (2x3) are constructed using the 6 value-weight portfolios
formed on size and book-to-market, the 6 value-weight portfolios formed on size
and operating profitability, and the 6 value-weight portfolios formed on size
and investment. (See the description of the 6 size/book-to-market,
size/operating profitability, size/investment portfolios.)
SMB (Small Minus Big) is the average return on the nine small
stock portfolios minus the average return on the nine big stock portfolios,
SMB(B/M) =1/3 (Small Value + Small Neutral + Small Growth)
- 1/3 (Big Value + Big Neutral + Big Growth).
SMB(OP) =1/3 (Small Robust + Small Neutral + Small Weak)
- 1/3 (Big Robust + Big Neutral + Big Weak).
SMB(INV) =1/3 (Small Conservative + Small Neutral + Small Aggressive)
- 1/3 (Big Conservative + Big Neutral + Big Aggressive).
SMB =1/3 (Small Value+Small Neutral+Small Growth) - 1/3 (Big Value+Big Neutral+Big Growth).
///////////////////////////////
"
.C18EXPLAIN14<-"Manually get FF5 time series
///////////////////////////////
Step 1: go to http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html
Step 2: using shift-f to find 5
Fama/French 5 Factors (2x3) TXT CSV Details
Fama/French 5 Factors (2x3) [Daily] TXT CSV Details
Step 3: download the data
///////////////////////////////
"
.C18EXPLAIN15<-"An efficient way to get the data
///////////////////////////////
Issue the following two lines
> x<-.showff5Monthly(0)
> .saveYan(x,\"c:/temp/ff5m.csv\")
[1] \"Your saved file is ==>c:/temp/ff5m.csv\"
The last line (3rd line) just a reminder.
///////////////////////////////
"
.C18EXPLAIN16<-"Order of data sets (in terms of date)
///////////////////////////////
Assume that we want to run Fama-French 3 factor model for IBM.
Step 1: download IBM's monthly price data from Yahoo!Finance
STep 2: estimate IBM's monthly returns
Step 3: download Fama-French 3 factors
Step 4: merge those two data sets
Step 5: run a linear regression
Note that for step 4, we have to pay attention to
how the data sets are sorted.
The data downloaded from Yahoo!Finance is sorted from the latest to oldest, see below.
Date Open High Low Close Volume Adj Close
2017-01-03 167.00 169.919998 165.339996 166.809998 3933100 166.809998
2016-12-01 161.949997 169.949997 158.300003 165.990005 3395000 165.990005
2016-11-01 153.50 164.660004 151.00 162.220001 3822800 162.220001
2016-10-03 158.059998 158.529999 147.789993 153.690002 3899000 152.308258
2016-09-01 158.320007 165.00 153.210007 158.850006 3501600 157.421875
2016-08-01 160.649994 164.949997 157.850006 158.880005 3131700 157.451599
2016-07-01 151.779999 163.600006 149.919998 160.619995 3648600 157.812973
2016-06-01 153.00 155.479996 142.50 151.779999 3678500 149.127457
2016-05-02 146.559998 153.809998 142.899994 153.740005 3857300 151.053207
while the data from Prof. French's data library is sorted the other way around,
i.e., from the oldest to newest, see below.
> .showff3Monthly()
DATE MKT_RF SMB HML RF
1 1926-07-01 0.0296 -0.023 -0.0287 0.0022
2 1926-08-01 0.0264 -0.014 0.0419 0.0025
> .showff3Monthly(-2)
DATE MKT_RF SMB HML RF
1090 2017-04-01 0.0109 0.0055 -0.0216 5e-04
1091 2017-05-01 0.0105 -0.0255 -0.0371 6e-04
///////////////////////////////
"
.C18EXPLAIN17<-"Merge data sets
///////////////////////////////
>help(merge)
///////////////////////////////
"
.C18EXPLAIN18<-"How to run a Fama-Frech 3 factor model?
///////////////////////////////
This is exactly the same as running a CAPM.
Assume that we have two columns of y and x
data -> data analysis -> regression -> ...
///////////////////////////////
"
.C18EXPLAIN19<-"How to interpret the result?
///////////////////////////////
Pay attention to
1) T-value: significant or not
2) P-value: significant or not
3) R square and adjusted R square
4) F-value: how good is the model
///////////////////////////////
"
.C18EXPLAIN20<-"Reference and links
///////////////////////////////
References
----------
Fama and French, 2014, A Five-Factor Asset Pricing Model
Fama, Eugene and Kenneth R. French, 1993, Common risk factors in the
returns on stocks and bonds, Journal of Financial Economics 33, 3056.
Fama, Eugene and Kenneth R. French, 1992, The cross-section of expected stock
returns, Journal of Finance 47, 427-465.
Links
----------
///////////////////////////////
"