Correlation Chart
 03-15-2008, 09:24 PM #1 Recycles dryer sheets   Join Date: Nov 2005 Posts: 159 Correlation Chart Not to bug you guys but I am curious if this chart looks alright and makes sense: Index Fund Correlation Here is part of the code used to generate the correlation data: PHP Code: ``` // Correlation Calculation      public function correlation(\$x, \$y) {          //Correlation = NSXY - (SX)(SY) / Sqrt([NSX2 - (SX)2][NSY2 - (SY)2])                    \$Ex;          \$Ey;          \$Exy;          \$Exx;          \$Eyy;          \$xy = array();          \$xx = array();          \$yy = array();          \$num = count(\$x);          for (\$i = 0; \$i < count(\$x); \$i++) {             array_push(\$xy, \$x[\$i]*\$y[\$i]);             array_push(\$xx, \$x[\$i]*\$x[\$i]);             array_push(\$yy, \$y[\$i]*\$y[\$i]);          }                    \$Ex = array_sum(\$x);          \$Ey = array_sum(\$y);          \$Exy = array_sum(\$xy);          \$Exx = array_sum(\$xx);          \$Eyy = array_sum(\$yy);          if (\$Ex != 0) {   // Make sure we are not dividing by 0             \$corr = ((\$num * \$Exy) - (\$Ex * \$Ey)) / sqrt( ((\$num * \$Exx) - pow(\$Ex,2)) * ((\$num * \$Eyy) - pow(\$Ey,2)) );          }          \$corr = round(\$corr, 4);          return \$corr;      }  ``` __________________
 Join the #1 Early Retirement and Financial Independence Forum Today - It's Totally Free! Are you planning to be financially independent as early as possible so you can live life on your own terms? Discuss successful investing strategies, asset allocation models, tax strategies and other related topics in our online forum community. Our members range from young folks just starting their journey to financial independence, military retirees and even multimillionaires. No matter where you fit in you'll find that Early-Retirement.org is a great community to join. Best of all it's totally FREE! You are currently viewing our boards as a guest so you have limited access to our community. Please take the time to register and you will gain a lot of great new features including; the ability to participate in discussions, network with our members, see fewer ads, upload photographs, create a retirement blog, send private messages and so much, much more! Join Early-Retirment.org For Free - Click Here
 03-15-2008, 10:35 PM #2 Recycles dryer sheets   Join Date: Mar 2005 Posts: 329 hi trixs Nice website. The correlation stuff makes sense - nothing that looks obviously wrong. I was playing with your backtester and I have a couple of suggestions. 1. would it be possible to add a box with the running total at the bottom of the backtester page ie as I enter % for each asset class the total increases and will give an error if it does not add up to 100% 2. Can you also add some notes for the Yaxis in the drawdown chart? Thanks -h __________________ __________________ Hope springs eternal in the human breast:Man never is, but always to be blest. The soul, uneasy and confined from home,Rests and expatiates in a life to come.
03-15-2008, 11:15 PM   #3
Recycles dryer sheets

Join Date: Nov 2005
Posts: 159
Quote:
 Originally Posted by lswswein hi trixs Nice website. The correlation stuff makes sense - nothing that looks obviously wrong. I was playing with your backtester and I have a couple of suggestions. 1. would it be possible to add a box with the running total at the bottom of the backtester page ie as I enter % for each asset class the total increases and will give an error if it does not add up to 100% 2. Can you also add some notes for the Yaxis in the drawdown chart? Thanks -h
Thanks for looking! Opinions from you guys are the best because you have an idea what is actually be displayed. I ask a friend and they have no idea what they are looking at.

1. Yes I intend add a total percentage box. However it requires Java and I have yet to learn Java .

2. Hmm - I overlooked that - Good idea!

 03-16-2008, 08:50 AM #5 Recycles dryer sheets   Join Date: Nov 2005 Posts: 159 Taking a look - Look's like I have some bug finding. Thank You EDIT: I went ahead and read that article and found where the discrepancy is coming into play. (btw, good article!) In the article they are using an aggregate correlation. First of all they start off with small cap blend and LCB. These two correlate together at about .75, which checks. Next they add other asset classes and get the aggregate correlation. The correlation model that I used on the site is checking the total portfolio correlation vs the US Market - In this case the S&P 500. I will change this to clearly state what data source. Also, 50/50 LCB/Commodities correlates with the US market( S&P 500) at .60 . When comparing the two distinct data sequences, LCB and Commodities, they correlate together at -0.17. My plan of action - Allow people to use decimal points!
 03-16-2008, 08:57 AM #6 Give me a museum and I'll fill it. (Picasso)Give me a forum ...   Join Date: Jan 2008 Location: LKN Posts: 13,813 Like these? Seriously, what you're doing is great and we look forward to seeing the finished product. __________________ __________________ No one agrees with other people's opinions; they merely agree with their own opinions -- expressed by somebody else. Sydney Tremayne Retired Jun 2011 at age 57 Target AA: 45% equity funds / 30% bond funds / 25% cash - radically changed Nov 2018 Target WR: Approx 2.5% Approx 20% SI (secure income, SS only)

 Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)