Showing posts with label factors. Show all posts
Showing posts with label factors. Show all posts

Tuesday, September 9, 2014

Frazzini goes French

A kind reader commented “Don’t know if you have seen it, but Frazzini goes French now too” .  I have profusely thanked and praised Kenneth French for his incredible data library.  Now, it appears I’ll have to repeatedly do the same for Andrea Frazzini.

Here is a quick plot of Quality Minus Junk (QMJ) around the world.  The code snippet is below the chart.

image

#ssrn citation to the paper
#Asness, Clifford S. and Frazzini, Andrea and Pedersen, Lasse Heje
#Quality Minus Junk (October 9, 2013)
#Available at SSRN: http://ssrn.com/abstract=231243



require(gdata)
require(quantmod)
require(latticeExtra)

#read spreadsheet
qmjFactors <- read.xls(
"http://www.econ.yale.edu/~af227/data/QMJ%20-%20Factors%20-%20monthly.xlsx"
,pattern = "DATE"
,blank.lines.skip = T
,stringsAsFactors = F
)
#convert spreadsheet data to R xts
#remove % with gsub, make numeric, and divide by 100
qmjFactors.xts <- as.xts(
do.call(cbind,
lapply(
qmjFactors[,-1]
,function(x){
df<-data.frame(as.numeric(
gsub(
x=x
,pattern="%"
,replacement=""
)
)/100)
colnames(df) <- colnames(x)
return(df)
}
)
) #date is first column; will use in order.by
,order.by = as.Date(qmjFactors[,1]) #as.Date(paste0(qmjFactors[,1],"-01"),format="%Y%m%d")
)

#xyplot(qmjFactors.xts)

asTheEconomist(
xyplot(
cumprod(1+na.omit(qmjFactors.xts))
, scales = list( y = list( relation = "same" ) )
, main = "Quality Minus Junk (2013)\nAsness,Frazzini, Pedersen\nhttp://ssrn.com/abstract=231243"
)
)

Friday, June 6, 2014

Dispelling Myths of Momentum | AQR Research Factory

In a recent working paper from the prolific AQR Research Factory, the authors seek to dispel ten common myths of momentum investing.  To their credit, they use the fine data publicly available from Kenneth French and use fairly simple metrics to make compelling arguments against the myths and for the momentum factor.  I replicated most of the calculations in R, and then in a blend of replication, summary, and discussion on process, used rCharts, Gmisc, and slidify to create the following writeup.  I hope others find it useful, and it serves a purpose much greater than a re-creation.

For another very detailed summary of the paper, see the post from Gary Antonacci of Optimal Momentum.

 

image

To make sure this gets seen by those who might not read the paper, I will copy the thanks section below.

Thanks specifically:

Wednesday, April 23, 2014

All the Factors | More Looks

Well, my last post Exploring Factors with rCharts and factorAnalytics got enough attention to motivate me to pull in some more Asness, Frazzini, Pedersen factors and plot them in some different ways.  The additional factors are US and global UMD (up minus down) and QMJ (quality minus junk) introduced in this paper.

Quality Minus Junk

Asness, Clifford S. and Frazzini, Andrea and Pedersen, Lasse Heje

October 9, 2013

Available at SSRN: http://ssrn.com/abstract=2312432

I used rCharts and dimplejs to draw a cumulative line chart.

Then I thought this would be a great opportunity to use the correlation chart spawned by rCharts issue 381.

 

Of course the next step is to simply merge the BAB (Betting Against  Beta) factors from the previous post, but I’ll leave that to you.  Let me know what you discover.

Monday, April 21, 2014

Exploring Factors with rCharts and factorAnalytics

Fama and French changed the financial world with their factors in 1993.  Another duo Andrea Frazzini and Lasse Heje Pedersen have expanded our world with their Betting Against Beta (BAB) and Quality Minus Junk (QMJ)  factors.  The combined factor set of Fama/French and Frazzini/Pedersen provides substantial insight into the historical performance of equities in the US and around the world.

Fortunately for us, the authors have also made available their factors.  Unfortunately, BAB and QMJ are not updated like the Fama/French SMB and HML. (actually discovered this is no longer true Frazzini data library)  Still though, combining these factors with the R packages factorAnalytics and rCharts allows us to do some amazing things.  Here is a quick example. Look for more soon.

Friday, June 1, 2012

System from Trend Following Factors

As I thought more about Trend Following Factors from Hsieh and Fung, I thought that the trend following factors might indicate a state/regime for the equity markets that could potentially offer momentum-style timing signals for a system on the S&P 500.  Now, THIS ABSOLUTELY SHOULD NOT BE CONSIDERED INVESTMENT ADVICE, especially since the factor data is very lagged and the testing is nowhere near comprehensive enough.  I will however try to replicate the factor methodology to get a more real-time indicator extended to any index in another post. What is most interesting to me is that this is ex-ante intuitive and the signal is just basic statistics.

From TimelyPortfolio
From TimelyPortfolio
From TimelyPortfolio
Comments have been very light. Please let me know your thoughts.

R code from GIST:

Friday, May 25, 2012

Trend Following Factors from Hsieh and Fung

The beauty of R and academic replication is that on the Friday before Memorial Day weekend I can read an academic paper and do some analysis all before breakfast.  In this case, the paper is

Hsieh, David A. and Fung, William, The Risk in Hedge Fund Strategies: Theory and Evidence from Trend Followers. The Review of Financial Studies, Vol. 14, No. 2, Summer 2001 .
Available at author’s site at Duke University: PDF file.

with data courtesy of the authors available at http://faculty.fuqua.duke.edu/~dah7/DataLibrary/TF-Fac.xls

Let’s get the factors into R and run some very introductory analysis on the Edhec data from PerformanceAnalytics.  The factors as defined by the authors are:

Trend Following Risk Factors from Fung and Hsieh, RFS (2001)
PTFSBD: Return of PTFS Bond lookback straddle
PTFSFX: Return of PTFS Currency Lookback Straddle
PTFSCOM:Return of PTFS Commodity Lookback Straddle
PTFSIR: Return of PTFS Short Term Interest Rate Lookback Straddle
PTFSSTK:Return of PTFS Stock Index Lookback Straddle

From TimelyPortfolio
From TimelyPortfolio

What a nice way to ease into the weekend. Now for the hard part--thinking about how I might use this.

R code from GIST:

Monday, April 30, 2012

French Global Factors

I have said it already in multiple posts, but Kenneth French’s data library is one of the most generous and powerful contributions to the financial community.  To build on Systematic Investor’s series on factors, I thought I should run some basic analysis on the Global Factors maintained by Kenneth French.  I cannot imagine how long this would take without the data library and the incredible set of R packages available.

From TimelyPortfolio
From TimelyPortfolio
From TimelyPortfolio
From TimelyPortfolio
From TimelyPortfolio
From TimelyPortfolio

R code from GIST: