$\textstyle \parbox{1.5in}{CS3352}$ $\textstyle \parbox{3in}{\Large CS3352 Homework~1}$ $\textstyle \parbox{1.5in}{2000 Feb~07}$


Due Thursday, 2000 Feb 17, at the beginning of class.


Contents



Withdrawal Problem Statement

One of the scariest questions retiring people face is whether they will outlive their money. After working for thirty or more years to accumulate money, suddenly the income stops but the expenses do not. Since middle and upper class people can easily live twenty to thirty years after retirement, accurate projections are required. Compounding the fear is the belief that, if the money runs out, it is likely to do so after an age where the person would be willing or able to return to work. On the other hand, people wish to enjoy their retirement and their retirement money so they are loath to lower their standard of living too much. In this homework, we will use historical data to predict the ``probability'' of bankruptcy for a given withdrawal rate.

On the flip side of the gradual reduction of one's investments during retirement is the accumulation of wealth during one's working years. Young workers, who are facing many major expenses, e.g., house, children, and vacations, frequently question if they need to save for retirement at all and, if so, how much. Using historical data, we will write a computer program that we can use to predict how much money a worker needs to save each year to accumulate, say, one million dollars for retirement. (One can determine a reasonable target using the program described in the preceding paragraph.)

1998 February, Trinity University professors Philip L. Cooley, Carl M. Hubbard, and Daniel T. Walz published an article in the American Association of Individual Investors' AAII Journal, volume XX, number 2. Apparently, the article caused quite a stir, receiving publicity in the Morningstar Fundinvestor and on Scott Burns's Money Page. We will create software that is more powerful, and hopefully more useful, that that described by the authors.

(Software like that we will write is for sale as commercial products. With a little more thought and a few features to make it more realistic, we may be able to post it on a web site and perhaps also write a short paper. Please let me know if you are interested. (Please do not let the preceding comment worry you about the program's complexity. It is at the level of a CS1320 programming project.))

Conceptual Model

Without loss of generality, we will concentrate on the retirement income question.

The question is ``Will I outlive my investments if I withdraw $xdollars every year?'' More specifically, ``What is the probability I outlive my investments if I withdraw $x dollars every year?''

Specification Model

The program's input includes:

Using historical data on investment returns from 1926-1997, the program will compute the value of the investment after n years of withdrawal.

For example, suppose one started with $1M invested wholly in large company stocks on 1946 January 01 and withdrew $40K per year at the end of each of two years. Large company stocks in 1946 returned -8.07% so we ended the year with

$1000000(1 - 0.0807) - 40000 = $879300.

The next year, our investment returned 5.71% and we then withdrew $40K so we ended up with

$879300(1 + 0.0571) - 40000 = $889508.

Thus, we withdrew $80K, but our investment shrank $110.5K.

Investment returns vary on a daily, monthly, and annual basis. If our investment value is ever nonpositive, we ran out of money and declare bankruptcy.

Investments can also be categorized according to type, e.g., large company stocks, long-term corporate bonds, and U.S. Treasury bills. To a first approximation, the return on most investment depends more on in which categories it is invested than on the individual investments within the category. For example, to a first approximation, it matters more that 50% of one's assets are in large company stocks than whether they are in Vanguard's 500 Index Fund than in several individual large-cap stocks. Since we are simulating, we will ignore these distinctions. U.S. Treasury bills are frequently considered ``cash'' since their duration is very short, e.g., three months.

As we might see in a future homework assignment, asset allocation determines, to a first approximation, both the size of return and how much the return varies. Historically, stock returns are largest but also most variable, while U.S. Treasury bill returns are smallest but more predictable. We will assume that our retiring couple has determined their reward-risk tradeoff by allocating assets into categories according to fixed percentages. A typical allocation is 60% large company stocks, 35% long-term corporate bonds, and 5% U.S. Treasury bills. At the end of each year, the couple will rebalance their investment to meet these fixed percentages by conceptually selling assets greater than their desired percentage and buying assets with percentages too low.

Although past performance does not indicate future performance, we will use annual return data from Ibbotson Associates [Ass95]. For each year between 1926 and 1997 inclusive, returns for

are listed. Inflation is not really a return but the decreasing value of money. For example, if inflation is 18.16% during 1946, we should really withdraw

$40000(1 + 0.1816) = $47264

at the beginning of 1947 to be able to purchase the same amount as we could at the beginning of 1946.

To answer our question of whether we will go bankrupt if we withdraw money for n years, we will determine the value of our investment starting in every year y and ending at the beginning of year y + n. For example, suppose we are interested in a ten-year time frame. Then, we determine the value of an investment starting at the beginning of 1926 and ending at the beginning of 1936, the value of an investment from 1927 to 1937, ..., and from 1988 to 1998. For each time period, we record whether we ran out of money or not. The probability of bankruptcy is the number of bankrupt-time periods divided by the total number of periods.

To ease the modeling, let us make a few assumptions:

Computational Model

Write a computer program determining the probability of not running out of money given

One approach to solving this problem is to write a computer program P that has command-line arguments for

This program will return an indication of error or, if no errors, the value of the investment at the end of the time period. We can write another computer program to run P through all of the historical data, accumulating the results.

I conjecture, but have not verified, that one pass through the data will yield answers for all the years, even without using an array of values for all the current time frames. Why not just use the simpler approach because the program's running time is so short, it is not terribly important.

Clarifications (2000Feb09)

Programming Niceties

It would be nice but is not essential that your program be flexible enough to accept monthly data rather than annual data. It would also be nice to accept any number of asset classes. An optional feature would be the ability to specify the frequency of rebalancing.

Verification

Your program should be able to recreate all the tables in the article by Cooley, Hubbard, and Walz. Note they use data through 1995, not 1997.

Of course, your program should also be able to do more:

I have also posted my computer program against which you can compare your answers.

Validation

I do not know how to validate the results. Does anyone have any ideas?

Accumulation Problem Statement

Write a computer program that determines the probability of accumulating a specific amount of money given

Hint: You should not have to do much work.

Questions to Answer

Please provide written or typed answers to these questions:

1.
Approximately what amount per year do we, as young people, have to save every year to obtain an eighty percent chance of accumulating $1M in 10, 15, 20, 25, 30, 35, and 40 years? Answer for a handful of ``reasonable'' asset allocations such as Cooley, Hubbard, and Walz chose.
2.
To a first approximation, how much can one contribute annually to an IRA? (Hint: See IRS Publication 590.) What must one do to make this enough to reach the $1M goal?
3.
What is the probability that $1M will last 10, 15, 20, 25, and 30 years assuming a withdrawal rate of $50K per year?
4.
A lot of people consider the Great Depression and subsequent decade an aberration. How does your answer to the previous question change when considering only the post-WWII period of 1946-1997?

What Files Do I Need?

The Ibbotson data is available.

My code, to compute the value of the investment after a particular period of time and starting at a particular year, is available. It runs on my Linux computer. The command line arguments are:

1.
the historical data file,
2.
a file containing the desired asset allocation,
3.
the initial investment value,
4.
the annual withdrawal amount as a negative number,
5.
the number of years to withdraw, and
6.
the year to begin the withdrawals.
The program to repeatedly invoke this program is omitted. Please report all errors and suggestions.

Submission Rules

Use any programming language you desire. Grading will be based predominantly on correctness, with a small portion on programming style and your written answers.

I will run your code on a computer science Linux computer so please check that it compiles and runs there. Please check that it compiles and runs without any errors or warnings. For example, the g++ compiler options to produce warnings are -Wall -pedantic. For example, I can compile using

g++ -Wall -pedantic foo.cc -o foo

Please submit your code, enough documentation to know how to compile and run your code, and possibly answers to me (oldham@cs.trinity.edu). If you need to submit multiple files, please use a command like

shar -m sourcefiles | mail -s "CS3352 Homework 1" oldham@cs.trinity.edu
Please do not submit executables or Microsoft Word or similar documents. I want to have the privilege of looking at your code.

Bibliography

Ass95
Ibbotson Associates.
Stocks, Bonds, Bills, and Inflation 1995 Yearbook.
Ibbotson Associates, Chicago, 1995.

Tips for Programming

Unlike many other activities in life, it is generally a good idea to incremental write a computer program. That is, start with a simple program, slowing adding features and complexity, being sure to check the program at each step. Here is one way to write the computer program.

1.
Write a ``hello, world'' program.
2.
Write a program that reads in the data, printing it out to the standard output. See also my tips on input in C++.
3.
Write a program computing the value of a stock-only portfolio for any particular time frame.
4.
Modify the program to permit holdings stocks and bonds. for any particular time frame.
5.
Modify the program to permit any asset allocation.
6.
Write a program to repeatedly run your other program.

If you get stuck, please come see me. Please do not get stuck on the input, output, or command-line arguments; these are not the point of the assignment.

If you need help with the math, come see me but bring your ideas written in math or English. See also the authors' appendix. Note, if the value of an investment goes negative, it should stay negative so there is no reason to abort a computation early.

Asset Allocation Classes

For the purpose of the program, we need not know the definitions of the different asset classes, but we include them for completeness.

Large Company Stocks:
Stocks can be divided into three groups: large, medium, and small, i.e., large-capitalization, mid-cap, and small-cap, according to the total worth of the company's stock. Some definitions split the categories according to specific monetary amounts. Do not believe it. Large-company stocks are stocks of companies among approximately the top third largest U.S. companies with publicly-held stock. Our data actually represents the stocks of companies in the Standard and Poor's 500 Stock Composite Index (S&P 500).
Small Company Stocks:
Stocks of U.S. companies among those having the smallest total stock worth. Our data actually represents the ``fifth capitalization quintile of stocks on the NYSE for 1926-1981 and the performance of the Dimensional Fund Advisors (DFA) Small Company Fund thereafter.''
Long-Term Corporate Bonds:
Bonds are categorized both by the time to expiration and by the issuer. ``Long-term'' generally refers to expiring in at least twenty years. ``Corporate'' means issued by a company. Our data represents the ``Salomon Brothers long-term, high-grade corporate bond total return index.''
Long-Term Government Bonds:
Bonds with long duration and issued by the U.S. government or affiliated agencies. Our data is ``measured using a one-bond portfolio with a maturity near twenty years.''
Intermediate-Term Government Bonds:
Bonds issued by the U.S. government of affiliated agencies and ``measured using a one-bond portfolio with a maturity near five years.''
U.S. Treasury Bills:
To pay for the federal debt, the U.S. government issues bonds. Treasury bills have a duration of one year or less. In particular, our data measures ``rolling over each month a one-bill portfolio containing, at the beginning of each month, the bill having the shortest maturity not less than one month.''
Inflation:
A general increase in the prices of goods or services. Our inflation measure is the ``Consumer Price Index for All Urban Consumer (CPI-U), not seasonally-adjusted.''
Quoted definitions come from [Ass95]. (Another good source of financial definitions is Vanguard's glossary.




2000-02-09