Date: 2000 Apr 18
We sketch the withdrawal and accumulation program specification, outlining its input, output, and computation.
2000Apr27: Added age to C++ program input specification. Added specification of C++ program's output.
2000Apr25: Added financial target inflation boolean to the input.
2000Apr18: Changed the monthly modification specification from proportional splitting to a 50%/50% split between capital appreciation and income return. Rationale: Proportional splitting is hard to specify if one return rate is positive and one is negative. Suggestions for a more realistic arrangement are solicited.
2000Apr18: Added input specification for the C++ program to the end of Section 2.
The program consists of three separate pieces:
Throughout the specification, we note possible features for future versions of the program. We need not program these for this version.
We specify the input from the user's point of view, i.e., what the WWW interface provides. The user needs to specify
The user should specify the monetary amounts:
The user should specify the time periods:
In an advanced version, we may permit specifying the range of historical data to use. For example, users might specify simulating using post-WWII data only.
The initial money is assumed to be invested at the beginning of the time frame. The first increment occurs at the end of the first time period. All investments are sold at the end of the time frame. For example, consider a time frame of twenty-three years starting in 1926 with an increment time period of five years. The initial investment is made 1926 Jan 01. Incremental investments occur on the last day of 1930, 1935, 1940, and 1945. The entire investment is sold on the last day of 1948.
The user should specify the desired asset allocation. Every rebalancing time period, assets are sold or purchased to move the investment back to the desired allocation.
Some users may wish to specify a fixed asset allocation, choosing among the following assets:
Alternatively, the user could specify one of three age-dependent formulae:
strategy | stock allocation | LT government bond allocation |
conservative | min(125 - age, 100) | remainder |
moderate | min(135 - age, 100) | remainder |
aggressive | min(145 - age, 100) | remainder |
Thus, the user should also supply a starting age.
The historical data for small company stocks and long-term corporate bonds does not provide separate capital appreciation and income returns so we omit these asset classes from our simulation. An advanced version might include small company stock data, assuming no income return. An advanced version computing for tax-free accumulation or withdrawal might also include long-term corporate bonds.
The program will simulate investment growth in either a tax-free or a taxable account, as specified by the user. If the investment is held in a taxable account, the user should specify:
The program assumes:
A future version might use historical tax information to 1) provide more accurate calculations and 2) show whether market returns and tax rates are correlated. It may also incorporate the actual historical capital gains tax rules, which have varied through time.
The WWW page need not ask the user for sensitivity analysis input. A future version may require input.
The underlying computation should support modifying the historical monthly return rates by a given fixed percentage. A positive number indicates exceeding historical return rates, while a (more likely) negative number indicates not attaining the historical rates. For assets with return rates specified separately as capital appreciation and income returns, the percentage should be split evenly.
As an aside, the annual modification amount M technically depends on the monthly returns according to the formula:
The C++ program's input should be read from the command-line arguments. See Table 1. Note that either the choice of the age-varying asset allocation formula and the age xor the fixed asset allocations are specified in the input. Also, the tax rates are omitted if taxes are not being computed. Collin and I decided to omit the database file names. The C++ program and not the CGI program will probably know their location.
Craig recommends that all input processing be performed inside some function to modularize the code.
The withdrawal and accumulation program produces the probability of meeting or exceeding the financial goal and also produces the average and standard deviation of the time frames' investment amounts. The probability, specified as the ratio of time frames meeting or exceeding the goal to the number of time frames, should be displayed as an integral percentage with maximum value 100%. To avoid misleading the user, the average and standard deviation should perhaps be rounded to three significant digits.
Probabilities should be displayed assuming
A future version might display histograms of the ending amounts.
For one set of input, the C++ program will produce the following output all on one line.
First, we will describe a computation without capital gains taxes. Then, we will revise the computation to incorporate capital gains taxes.
The program should compute the probability of success and the average and standard deviation over all time frames. So that the historical return data need not be repeatedly read from disk, it could be read into STL vectors. Secondly, this data might be packaged in a class with a function returning the historical rate for a specified asset, year, month, and income or capital appreciation. Using such a class will hopefully avoid indexing problems.
A statistics class accumulating the probability of success, the average, and the standard deviation could ease collecting this data. Its constructor could take the desired target. Every time an additional piece of data is computed, a class member function could be invoked. Its destructor could print the statistics.
In the text below, we will concentrate on determining the final investment value for a particular time frame. We will assume the program will loop through all possible time frames.
To compute the final tax-free accumulation or withdrawal amount, useful values include
The steps to perform at the time frame's beginning include:
The steps to perform at the end of each month and beginning of the next month include:
When the simulation of this time frame ends, record the total investment's worth.
(This presentation is different that that discussed in class Thursday, 13 April. I conjecture this approach is more precise than the approximation discussed in class.)
Taxes on income could easily be incorporated by modifying the monthly return rate to pay taxes monthly. Taxes on appreciated assets are more complicated because the capital gains tax due is the product of the increase in the asset's value and the capital gains tax rate. Thus, we will need to remove the basis of all purchased assets subject to capital appreciation.
Useful values and data structures include
For each asset subject to capital gains, we should record the month of each purchase, its purchase price, and its current value. When the difference between the current month and a purchase's date equals the asset holding time period, that purchase should be sold. Each month's purchases is added to the other end of the queue. Recording the total value of each asset simplifies some calculations. Cash, i.e., U.S. Treasury bills, are not subject to capital appreciation.
The steps to perform at the time frame's beginning include:
The steps to perform at the end of each month and the beginning of the next month mimic the actions a human investor would perform.
Overallocated assets, i.e., assets exceeding their allocation, should be sold to purchase underallocated assets. Purchasing assets incurs no penalties, while selling assets requires paying capital gains taxes. The amount of capital gains taxes to pay depends on each purchase's initial price.
A series of formula manipulations yields a set of linear equations to solve. Underallocated assets are omitted from the linear equations. Assume assets types 1, 2, and 3 are overallocated. Let Ai be the desired asset allocation fraction, e.g., 0.60, for each type i. Let ai represent the total dollar amount invested in the asset. Let t represent the total dollar amount in all assets. Let girepresent the marginal capital gains tax rate for the oldest purchase in asset type i. For example, suppose the initial price of the oldest purchase may have been $100, its current value is $150, and the capital gains tax rate is 20%.2 The marginal capital gains tax rate is the ratio of the tax paid if all of the purchase is sold to the purchase's value, i.e., the ratio of 0.20*max(0, 150 - 100) and 150. Let fi represent the fraction of the asset to sell.
Solve this set of linear equations for fi.
= |
Among all the assets with fiai greater than the oldest purchase's
current value, sell the asset with the smallest marginal capital gains
tax rate so minimize the tax paid. If this occurs, form a new set of
linear equations and repeat the calculation. Finally, all the fiai products are less than or equal to asset's oldest purchases'
current values, sell fiai from each asset, adding the money to the
U.S. Treasury bill asset. Then purchase underallocated assets using
cash from the U.S. Treasury bill asset. The previously overallocated
asset amounts should remain unchanged.