User:Justin Roth Muehlmeyer/Notebook/307L Notebook/Finance

From OpenWetWare
Jump to: navigation, search

Day 1

The topics of this lab were unbounded and infinite, most of the work was in trying to narrow our project to a realizable goal. After exploring some deeper topics that led down un-answerable (and endless) philosophical and political paths we decided we must narrow our search. So we decided to set some goals, then choose a topic of finance that would lead to good excercises in the following:

  • data analysis
  • computational technique
  • finance terminology
  • historical perspective

We remembered a lab we did in PHYS 290 with Dr. Stephen Boyd where we analyzed stock data. The excercise we did in that class was in loading stock data to MATAB, then perfoming simple and exponential moving averages of that data. This excercise gave us a bit of inspiration, or rather helped us to focus our topic search. After contacting Dr. Boyd about the source of his stock data, and discussing with Dr. Koch, our goal then eventually became the following:

Purpose of Our Finance lab

The purpose of this lab is to study rate growth in the stock market, 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?
  • Where do we get this data?
  • How do we simulate "investment" with the historical data in hand?
  • What does it mean to expect a rate of growth?
  • Is there an average rate of growth, or maybe even a rate that fits some known distribution?

What we learned on the way

What we learned from our initial exploration:

Financial gurus have created market indicators called "indices" to chart the progress of sectors of the stock market. Well known market indices are the NASDAQ, the S&P 500, and the Dow Jones. A stock index is basically a summation of the stocks of a selected group of companies. The selection of course is chosen based on the purpose of the index, to follow a certain industry within the ecomomy.

We learned that these indices are created using two different methods:

  • price weighted: is just the sum of the prices of all the stocks making up the index. An example is the Dow Jones Industrial Average which is a simple summation of the prices divided by the Dow jones "divisor", the number of component companies. In this way it is a true average.
Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "":): {\displaystyle \text{DJIA} = {\sum p \over d}}

where p is the price of the shares and d is the # of companies.

  • Market value-weighted: accounts for the size of each company making up the index such that price changes in smaller companies don't effect the index more than they should as compared to the bigger companies.

We found these methods very interesting and spent a considerable amount of time exploring this as a possible purpose of our lab. We considered "making our own indices", or making an index that would capture the trends of the recent financial crisis. But we decided that this would be un-necessary and that we should use the indices already out there.

Another idea we pursued was calculation of net present value, and the comparison of investments at different times. We researched into net present value, with the idea in mind that we will calculate the true value of investing in US Treasury bonds over a period of time.

Net present value (NPV) is a comparison of a dollar today to a projected value for the same dollar at some point in the future. Present value is the value on a given date of a future payment or series of future payments, discounted to reflect the time value of money and other factors such as investment risk. A common model of present value is the compund interest formula that calculates how much money you will have in an account make a certain interest after a certain amount of time.

This led us to bonds. Maybe we could compare bonds with savings accounts, or other securities like stock. We ended up learning a little about bonds...

A bond is a loan in the form of a security. A security is defined as something fungible (exhangeable with itself like currency, oil, gold). However, a bond is not an equity like stock. Some bond vocab we learned:

  • principle/nominal/face value: the ammount which the issuer pays interest, which has to be repaid in the end.
  • issue price: the price the investor buys the bond when issued.
  • maturity date: the time the issuer repays the nominal amount.
  • yield: percent that measures cash return to owners of the bond.
  • nominal yield: yearly total of interest paid to owner divided by principal face value of bond.

We might use our new knowledge of bonds and compare bonds yield rates to the average growth rate fo the stock market. Which is a higher growth investment? Obviously, this is a complicated question. The stock market may grow faster, but it falls faster too and is high risk compared to bonds (especially US treasury bonds). Therefore comparing stock to bonds is sort of silly but might prove to be a worthwhile comparison.

What does it mean to invest in the Dow Jones Industrial Acerage?

Of course, one can not invest in an index, it does not actually exist as something with equity that you can purchase. However, many financial firms create funds that purchase exact proportions of stock in the companies of the index. Therefor, buying into one of these funds one can expect his growth to directly follow the trends of the index, as if he had invested in the index itself.


We consulted Dr. Boyd about the source of his stock data for our MATLAB class finance day. There we were able to get stock data for any choice of stock, and it exported it right to an excel document!

The source of our data is:

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.

Day 2

We were still somewhat adrift regarding real lab-worthy content of our lab, so we leapt at Dr. Koch's idea to analyze randomly-generated time windows over the course of the DJIA. We initially chose 10-year windows in order to compare to a 10-year US security bond. When creating the code to do this, we ended up discussing whether we should take least-squares fits of each window, or to take 10-year "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. Least-squares 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.


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. 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 50-year windows, all with 100 randomly-generated iterations. Please see my excel file for the data analysis.

File:DJI weekly since forever ANALYSIS.xls

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.

Hypothesis: The shorter windows will be more sensitive to small changes in the market, so their slopes will be more severe. This is proven to be generally true, except for the last slope average. See data below.

Snap Shot Window Average Slope after 100 iterations and 20 Trials
10 Year 2.997432
20 Year 2.286577
30 Year 2.002178
40 Year 1.891791
50 year 1.999209


Since the "snap shot" method uses the slopes between only two points (the start price and end price), it then tells us directly what my rate of growth would be if I invested X amount of money at some random time then waited exactly ten years and sold at that sell price ten years later. The slopes above then represent the change in price for my investment period: it is a direct rate of growth for my investment.

The least squares method on the other hand (which I will compare in my summary) accounts for the trends within that period, so that someone who invested only 9 years, 10 months might see growth closer to the fit than the snapshot.

We notice that these slopes are all positive, meaning that over all these time frames, there is a positive rate of growth. It is then safe to say that investing in the stock market for periods of time as long as 10 years will generally show positive rates of growth.

The rates of growth generally decrease as the size of the "snap shot" increases, validating our hypothesis that you will have higher rates of growth over shorter periods because the slope is more reactive to the faster changing conditions of the stock prices.

Our data of course is only of the Dow Jones Industrial Average, not of the entire economy. One must be cautious then when making statements about investing in the stock market as a whole when we have only used one index. Keep this in mind.