Physics307L:People/Muehlmeyer/Finance
Contents
Purpose of Our Finance lab
^{SJK 16:42, 19 December 2008 (EST)}The purpose of this lab is to study rate growth in the stock market, to learn how to attain good financial data and to analyze it. We will do this by asking a question:
If one makes a ten year investment in the stock market, what should one expect, based on historical analysis, to be one's rate of growth?
Questions that come about from this question:
 What financial data/market would be a good indicator for such a broad question?
Stock indices are created for the purpose of tracking sectors of the economy. An index is constructed by averaging the prices of specific companies chosen. We decided to use the Dow jones Industrial Average with a time frame of its entire lifetime so that we can say that our determined averages are a good representation of the entire history of the stock market. Of course the Dow Jones does not represent the entire stock market, but it is generally taken to be the main indicator of its health.
 Where do we get this data?
The source of our data is: http://finance.yahoo.com. This website was used by Dr. Boyd in his MATLAB class last fall.
 How do we simulate "investment" with the historical data in hand?
This question proved to be the challenge of our discussion. We knew that if we wanted unbiased results, we needed to simulate random investment times. We will do this by creating random time frames of specified intervals. We need to run many of these random investment intervals in order for us to say that this result represents the trends of the stock market.
We initially chose 10year windows in order to compare to a 10year US security bond. When creating the code to do this, we ended up discussing whether we should take leastsquares fits of each window, or to take 10year "snapshots," which find the slope from the two stock prices at the endpoints of the window. Snapshots make sense in that a person investing during that exact time period would see exactly that rate of growth. Leastsquares fits show more of a trend over the 10 years, so that someone who invested only 9 years, 10 months might see growth closer to the fit than the snapshot.
We will analyze these two methods seperately to compare: least squares fit and "snap shots" over the entire course of the DJIA. The data below was analyzed in parts. My lab partner Alexander did the "least squares" method using MATLAB. I used EXCEL to analyze the "snap shot" method. We hoped to see similarities, and are not sure what difference to expect. The exploration of this is the purpose of my summary.
This purpose of course evolved after much deliberation, one can read what we learned on the way about finance and see how our lab evolved in my lab notes:
The source of our data is: http://finance.yahoo.com
Data
Snap Shot Method
My part of the analysis was the "snap shot" method wherein I found the slope of the line between the start and end date of the price plot for random intervals. I did this for the same exact windows as my partner Alexander who did the least squares method. The windows were 10, 20, 30, 40, and 50year windows, all with 100 randomlygenerated iterations. I then did 20 trials of these 100 iterations and averaged. To simulate random investment it was necessary to create a function that would randomly choose a start date, such that the end date (a specified distance from that start date) would not exceed the dimensions of our stock data matrix. I then used excel indexing to get the price values of those start and end dates. This gives us two points between whcih we can do a simple rise over run function to get the slope. The slope presented in the plot can safely be said then to be a reasonable expectation for ones rate of growth on his investment if he invested at any random time, and waited for the given time interval. Please see my excel file for the data analysis in the lab manual.
Snap Shot Window  Average Slope after 100 iterations and 20 Trials ($/week) 
10 Year  2.997432 
20 Year  2.286577 
30 Year  2.002178 
40 Year  1.891791 
50 year  1.999209 
Least Squares Method
The least squares method actually fits a best fit line to the interval, and when this is done for many random intervals, and averaged, the result then represents the expected rate of growth over the entire stock market for that specific time interval. The diagrams depict the best fit line for one iteration of the specified time interval.
Slope Data [$/week]  Sample Window  









The averages for the 20 Trials are:
Snap Shot Window  Average Slope after 100 iterations and 20 Trials ($/week) 
10 Year  2.782245 
20 Year  2.441755 
30 Year  1.915845 
40 Year  1.575945 
50 year  1.472495 
Conclusion
The least squares method has lower averages, and this is expected, since the least squares method accounts for the changes within the time interval, not just the endpoints like the "snap shot" method. The slopes follow the actual trends of the market better. In other words, it accounts for any random time of investment, and is probably more accurate. However, it does not tell us directly the rate of growth expected for that given time interval. So in conclusion, the two methods prove to give results that represent two different things entirely:
Least Squares Method: Gives the average rate of growth of the stock market.
"Snap Shot" Method: Tells me what rate of growth I should expect if I invest at a random time over a specified time interval.
They are two different things.
Luckily we acquired numbers that are reasonable close, and it is obvious that our methods were coordinated properly over the same data.
It is also safe to say, just by giving the two tables a glance, that the rate of growth that one expects of any investment over any time in the stock market is something between 13 $/week per share. This is why long term investment is almost universally considered/guaranteed to give positive returns on one's investment. Retirement IRA's and Education IRA's are all based on this concept. Of course, if one really wants to see extreme rates of growth, all that one has to do is decrease his time frame window. This of course is a full time job/hobbie for many investors who purchase and sell stock on a daily or weekly basis.