to your HTML Add class="sortable" to any table you'd like to make sortable Click on the headers to sort Thanks to many, many people for contributions and suggestions. Licenced as X11: http://www.kryogenix.org/code/browser/licence.html This basically means: do what you want with it. */ var stIsIE = /*@cc_on!@*/false; sorttable = { init: function() { // quit if this function has already been called if (arguments.callee.done) return; // flag this function so we don't do the same thing twice arguments.callee.done = true; // kill the timer if (_timer) clearInterval(_timer); if (!document.createElement || !document.getElementsByTagName) return; sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; forEach(document.getElementsByTagName('table'), function(table) { if (table.className.search(/\bsortable\b/) != -1) { sorttable.makeSortable(table); } }); }, makeSortable: function(table) { if (table.getElementsByTagName('thead').length == 0) { // table doesn't have a tHead. Since it should have, create one and // put the first table row in it. the = document.createElement('thead'); the.appendChild(table.rows[0]); table.insertBefore(the,table.firstChild); } // Safari doesn't support table.tHead, sigh if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; if (table.tHead.rows.length != 1) return; // can't cope with two header rows // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as // "total" rows, for example). This is B&R, since what you're supposed // to do is put them in a tfoot. So, if there are sortbottom rows, // for backwards compatibility, move them to tfoot (creating it if needed). sortbottomrows = []; for (var i=0; i
What is the "typical" annual trajectory for the S&P 500 during a year?
We're attempting to answer that question today using some 66 years worth of historical data for the S&P 500 from 1 January 1950 through 31 December 2015, as published by Yahoo! Finance.
The way we'll do that is to calculate each trading day's closing price for the S&P 500 for each of these years as a percentage of the value at which it closed on the first trading day of each year. Then, we'll calculate both the average percentage recorded for each respective trading day of all these years and also the median percentage recorded for each respective trading day of each year. The results of these calculations should reasonably represent what might be considered to be the "typical" annual trajectory of the S&P 500.
As an added bonus, because the actual trajectory of the S&P 500 during these years can be very different from these "typical" trajectories, we'll also identify the best ever and worst ever values recorded on each trading day during this 66 year-long period, just to give a sense of how different the actual performance of the S&P 500 has been with respect to its "typical" performance. Our results are presented in the following chart, where the divisions on the horizontal axis roughly correspond to each calendar month of the year.
In the chart above, the mean annual trajectory of the S&P 500 would involve the S&P 500 rising to be 108.5% of the closing value recorded on the first day of the year for the index. The median annual trajectory comes out slightly higher at 109.7% of the index' first day of the year closing value.
Meanwhile, the best ever trajectory shown in the chart above, which represents the highest value recorded in any year, and not the trajectory of any specific year, shows the S&P 500 reaching as high as 144.1% of its first day of the year starting value by the end of the year. The worst ever trajectory, representing the lowest value recorded in any year for each trading day, shows the S&P 500 falling to be just 61.5% of its value at which it closed on the first day of the year.
Just for fun, lets zoom in on just the mean and median annual trajectories for the S&P 500.
The median values shown above represent the actual values at the middle of the range of values we calculated for each trading day from 1950 through 2015. The average values reveal the extent to which abnormally strong or abnormally weak performances in particular years within the sample either pulled the mean trajectory above or below the median recorded value.
We'll leave it up to you to decide which is more "typical" of the historic annual trajectory of the S&P 500!
Yahoo! Finance. S&P 500 Historical Prices, 1 January 1950 through 31 December 2015. [Online database]. Accessed 11 July 2016.
Labels: data visualization, SP 500
Welcome to the blogosphere's toolchest! Here, unlike other blogs dedicated to analyzing current events, we create easy-to-use, simple tools to do the math related to them so you can get in on the action too! If you would like to learn more about these tools, or if you would like to contribute ideas to develop for this blog, please e-mail us at:
ironman at politicalcalculations
Thanks in advance!
Closing values for previous trading day.
This site is primarily powered by:
The tools on this site are built using JavaScript. If you would like to learn more, one of the best free resources on the web is available at W3Schools.com.