Better Hedge Ratios for Spread Trading
Paul, Thank you very much for sending this; I've seen the lightning talk slides, and spent some time playing with it. I do have a couple observations. First, often it seems like if I use the inverse of your code I get better results. i.e. I find that r$loadings[1,1] / r$loadings[2,1] is closer to what I get using other hedge ratio calculation methods. I attached a hedge ratio calculating function called "btcdHedge" to use as a comparison. I took the code for this function from http://quantivity.wordpress.com/2011/10/02/proxy-cross-hedging/ If I use btcdHedge to calculate the ratio between SPY and DIA since 2011-01-01, it tells me to sell 1.070554 DIA for each share of SPY that I am long. That is very close to the 1.070894 I would get if I used OLS with a zero intercept If I use OLS with a floating intercept, I get 1.206745. If I use your TLS code, I get 0.777546 So, your TLS code is the only one that gives a ratio of less than 1. However, if I use the inverse of your code I get something close to OLS with floating intercept r$loadings[1,1] / r$loadings[2,1] [1] 1.286098 Second, You say "Forcing a zero intercept requires an additional step: recentering the data around their means prior to the PCA." However, I get the same values regardless of whether I center around the means. Thanks, Garrett
On Tue, Nov 29, 2011 at 12:08 PM, Paul Teetor <paulteetor at yahoo.com> wrote:
R-SIG-Finance community: I recently posted a short paper entitled Better Hedge Ratios for Spread Trading: http://www.quanttrader.info/public/betterHedgeRatios.pdf The topic is pretty arcane but important to spread traders. A surprizing number of textbooks and practitioners simply use ordinary least squares (OLS) to calculate their hedge ratios, but OLS can give misleading results. The paper shows how to use total least squares (TLS) to obtain a better balanced spread. The needed R code is simple and included in the paper. The paper is based on a lightning talk I gave at the R/Finance Conference back in April. I welcome all comments. I can't guarantee I will quickly incorporate your feedback into the paper, unfortunately. Heck, it took me seven months just to get out this first version. Paul Teetor Elgin, IL USA http://www.linkedin.com/in/paulteetor "For quant traders, there are no bad days in the market. It's just more data." [[alternative HTML version deleted]]
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
-------------- next part -------------- An HTML attachment was scrubbed... URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20111129/ed489ab4/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: BTCDhedge.R Type: text/x-r-source Size: 2860 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20111129/ed489ab4/attachment.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: BetterHedgeScratchwork.R Type: text/x-r-source Size: 540 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20111129/ed489ab4/attachment-0001.bin>