Jay's Asset Allocation Blog

Blog about my off-hours work on the problem of Asset Allocation including but not limited to Portfolio Optimization algorithms, algorithms and approaches for improved estimation of Asset Allocation inputs and other potentially related items.

Saturday, August 30, 2008

Updates to the akutan project

Talk about open source. I've just spent the last week cleaning up the javadocs for the files in the akutan library. This library contains a bunch of code for portfolio optimization, and some other interesting financial tidbits. It also has an example program/applet which I have on my website, but this is just a demo of the library, it is not a tool for performing asset allocation.


I've been planning on building an Asset Allocation workbench so to speak for some time using the components in the library. I got stuck thinking it should run inside eclipse as a plugin, but realize that was really slowing me down, so it's going to be a good old Swing app which I'm pretty quick at Swing so it'll actually start coming together soon I hope. My long term goal is to put together a pretty respectable tool for asset allocation. We'll see how I do.


On other fronts I continue to work gathering the data to do a study on Black-Litterman and see if I can get to the bottom of tau and the use of the posterior variance. I'm also back to to the entropy diversification paper I wrote some time ago and recently took off my website. I didn't use a really good dataset for the first analysis, and I'm hoping using a better data set with more different assets will give me some more interesting results.

4 Comments:

Blogger Alberto Santini said...

Jay,
your resources are very interesting. We developed an asset allocation application written 100% javascript (ConPA), implementing the dual method of Goldfarb and Idnani (1982, 1983) for solving quadratic
programming problems of the form min(−dT b + 1/2bTDb) with the constraints AT b >= b0.

ConPA: http://proplus.aptanacloud.com/ConPA/ConPA.html
Blog: http://proplusblog.blogspot.com/
Site: http://www.pro-plus.biz/

Any your suggestion, comment or critic is welcome.

Thanks in advance,
Alberto Santini

September 10, 2008 5:36 AM  
Blogger lowstderror said...

Jay, I googled your name yesterday. I know you have a CFA and I was curious of your background. To my pleasant surprise, you have a web presence with regard to the Black - Litterman model. Kudos on the paper you wrote about BL !! I hope your implementation is coming along. Let me share some interesting things that I have seen in my experience, at least interesting to me, (and because I like to talk about it). Forgive the lack of completeness in exposition upfront, as I don’t have much time.



1.)

There are many times I have had an ‘aha!’ moment when reading financial literature. One of these moments for me came from a description of tau from the paper: Blamont and Firoozye (2003) “asset allocation model” global markets research: fixed income research, Deutche Bank , Italy .

Paraphrase:” Interpret tau*SIG as the std error of the estimate of the implied equilibrium return vector II. so the scalar tau is approximately one over the number of observations.”



To me this was ‘aha!’, the central limit theorem (CLT) at play in multivariate statistics. Recall that in univariate stats, roughly, CLT says that given a random variable (RV) X of any dist, with mean u and variance sigma^2, then if we define another RV, Y = mean(X) = sum(X)/n then Y approaches normality for large n, and has mean u and variance = sigma^2/n. (this is std error of the estimate squared)

In portfolio optimization we are in the multivariate case. A very cheap starting point or proxy for each E(R) in the vector II, could be the historical mean for that asset using n observations. So we would have a vector of RV’s Y with:

mean of II = vector of u

variance/cov matrix of II = SIG / n = tau*SIG (defining tau = 1/n) (again this is std error of the estimate squared)



There you have it, there is some reason to suggest that tau be defined as 1/n. Practical problem: In reality you are not using the historical means for E(R) of each asset in II, so you may not know the number of observations n to use. Also in BL it is implicitly assumed that II are normal RV’s so one must assume that n is large.



2.)

I had the pleasure of sitting as a pupil under Gerard Cornuejols, for a course in Optimization in Finance. It has been interesting to see that the class notes have been published as a book recently on amazon: http://www.amazon.com/Optimization-Methods-Finance-Mathematics-Risk/dp/0521861705/ref=sr_1_1?ie=UTF8&s=books&qid=1221226026&sr=1-1

I have the PDF notes from 2003 that I can send upon request, and I have this book.

Several points of interest are derived from this experience.



a. One of the biggest sources of variability in output of port opt with BL is the initial choice of equilibrium weights. This would be fun to study.



b. Consider L1 risk, rather than defining risk simply as variance of returns.



c. One of the inputs that makes the frontier unstable is the estimation of covariance matrix. I had fun implementing a companion piece to the BL literature from Litterman paper on Estimation of Covariance Matrices (1998): http://www.gloriamundi.org/detailpopup.asp?ID=453056600

I have matlab code for implementing this paper, that I am willing to distribute, anyone just ask me. Basically they use a Garch(1,1) model or more simply stated: exponentially weighted moving average covariance matrix. This provides a more smooth transition from day to day rather than simple using a uniformly weighted UWMA covariance estimation. In addition they assume the data comes from a multivariate distribution of mixed normals, that is, most days with probability p the data comes from a normal with some variance, but on some days with probability 1-p the data comes from a normal dist with a larger variance.

Also regarding covariance matrices, I saw a good exposition of estimating covariance using a factor model in this book: Credit Derivatives: Erik Banks http://www.amazon.com/Credit-Derivatives/dp/B001E5F7AI/ref=sr_1_2?ie=UTF8&s=books&qid=1221229579&sr=1-2

Using a factor model is a great idea because really what we are after is an ‘expected’ covariance, not just a historical one.



d. Interesting empirical studies should be done to backtest a managed portfolio using BL and that same managed portfolio not using BL. I have written a detailed package of matlab code for backtesting, rebalancing a portfolio and calculation various summary stats: turnover ratio, P&L, max drawdown, etc. and tried this a bit. The main point is that it would be interesting to compare these stats when using BL to not using BL.



e. An important point about rebalancing porfolios is the subject of transaction costs. I have implement in matlab some code for linear transaction costs for min variance portfolios. This applies a penalty that increases linearly as you move away from the current weights. Future implementation on this subject should be a step transaction cost. This would be more difficult, the idea is that in reality transaction costs have a fixed fee for even a tiny trade volume. A linear penalty does not account for this step on the low end. This step is needed so that the optimal weights first must surpass a step penalty then overcome the linearly increasing penalty.



f. another fun piece of work that I did was looking at the positive definiteness of estimated covariance matrices. This is required in nonlinear programming for convexity. You can test for this by checking that all eigenvalues are >= 0 (for positive semi-definiteness.)



PS what editor do you use for writing your paper with equations. I use winedt and miktek and mathtype.

September 12, 2008 8:06 AM  
Blogger Jay said...

stderror, thanks for the comments. If you read the paper you'll see that it follows easily from Theil's mixed estimation model used by Black and Litterman that τ is a standard error-like term. My point being that most people implementing (everybody but He) set τ to 1 or some non-intuitive value, and it would be simpler if they leave it out as it introduces complexity for no advantage. ω allows enough for the mixing of the prior and the views.
A recent thesis stated that the results were worse using a posterior variance, and I am interested in determining if that is true in general as one could simplify the model and improve the results at the same time by eliminating τ in that case.

September 23, 2008 6:49 PM  
Blogger emily parrr said...

this kind of blog always useful for blog readers, it helps people during research. your post is one of the same for blog readers.

Thesis Papers

May 12, 2010 12:34 AM  

Post a Comment

<< Home