You are here:

Advanced Math/compound interest, margin of error



I am calculating a projected account balance after a series of investments using an average rate of return.

Say I have $10,000 to invest and I make 1 investment everyday for 1 year (365 investments compounded daily) with an average return of 0.5% per investment (some winners, some losers of varying amounts but averaging 0.5% after the year).

When I calculate the projected balance after one year I get $61,746.53 { A = 10000(1+.005)^365 }

However, if I randomly choose a return for each investment(returning an average of .05) and I write them out by hand and calculate the actual ending balance after that simulated year, the balance is obviously not the same as the projected balance using the above equation.

My question is:

Is there a way to make a more accurate forecast of the ending balance using the average return despite the random distribution of returns that will occur in real time? I'm thinking of some way of accounting for the margin of error..

Thanks for the help,

ANSWER: This is pretty close to a classic log-normal distribution problem. First, your formula for calculating the ending balance, A, is based on the standard formula

(1)  A = P(1 - r/n)^n,

where P = initial principal ($10000 for your eg.), r = annual interest rate and n = number of times the balance is compounded in a year (I'm assuming a 1 year duration for all of this). Your daily interest rate of 0.5% = 0.005 translates to

r = (0.005)365 = 1.825 or 182.5% per year.

Since the balance is compounded so frequently, eqn. (1) can be approximated for n -> ∞ as

A' = Pe^r

For comparison, using r = 1.825, A' = 62027, which very close to your result via eq. (1). This being the case, we can treat the randomness in r using a log-normal probability distribution by the transformation

r = ln(A/P)

where we'll take M = mean of r and V = variance of r, which you can specify (eg. M = 0.005 for your problem). This distribution is well documented; the statistics you want for A (or actually A') are

Mean of A/P = MA = e^(M+V/2)  and

variance of A/P = VA = (e^V - 1)e^(2M+V).

A little complicated but there you have it. Note that these are the mean and variance for the balance at the end of a year; for more than a year, just replace r by rk where k is th number of years.

What seems to be missing in this problem is "... making 1 investment everyday (365 investments ...". The above analysis doesn't take into account this daily addition, which would presumably be $10000/365 = $27.40/day. Let me know if this is really what you want. BTW, you would make the most money at the end if you invest it all in the beginning.


[an error occurred while processing this directive]---------- FOLLOW-UP ----------

Thanks for the quick response. I don't think I explained the method of interest accumulation very well so the solution you created may not be applicable.

The 0.5% return is the AVERAGE return per day, once 'looking back' at the year...NOT a FIXED return per day. (some days may be 3%, others may be -3%, but the average after all is said and done, comes out to .005%)

And the full principle will be invested each day including interest earned/lost the previous day.

For example, I will lay out a simulated 5 days of investments.

Starting capital: $10000.00

Day 1: + 2.0%
New Capital: $10200.00 ----(10000.00 + (10000.00 * .02))

Day 2: + 1%
New Capital: $10302.00 ----(10200.00 + (10200.00 * .01))

Day 3: - 1%
New Capital: $10198.98 ----(10302.00 - (10302.00 * .01))

Day 4: + 2%
New Capital: $10402.96 ----(10198.98 + (10198.98 * .02))

Day 5: - 1.5%
New Capital: $10246.92 ----(10402.96 - (10402.96 * .015))

Final Balance after 5 days:

Average return over those 5 days:
(.02 + .01 - .02 + .02 - .015) / 5  =  0.005

So if I plug an average rate of return into the compound interest formula, I can come up with a reasonable estimation of ending balance after a given number of days, given that the average daily return over those days is r (in this case, .005).

However, when I write this out by hand (or in a spreadsheet) for 365 days of simulated returns in which the average of those returns = .005/day, I get a smaller number for ending balance than the compound interest formula. I am looking to account for that margin of error that is due to the random distribution of returns that occur from day to day.

If I use the compound interest formula to compare results for that 5 day period, I get [ $10254.51 = 10000(1+.005)^5 ] as the ending balance compared to $10246.92 in the simulated return. Over longer periods of time, this gap in results becomes larger... I am looking to account for that gap.

Hopefully that represents my intent a little better. If you need further clarification, let me know.

Thanks again,

ANSWER: I understand this better now. You have an initial amount of $10000 which gets compounded each day, but the interest rate at which the return (or balance) is calculated varies from compounding period to period. Because of the fluctuations in the interest rate, the actual return after n periods is different than what you would calculate using the average of the interest rates over the same number of periods (total time). You want an estimate of the magnitude of this deviation as a function of the mean and variance of the interest rate and the total length of time (total number of accounting periods). This is an interesting problem.

To start, define the amount accrued over the total time consisting of n compounding periods as Am. Using the exponential version of the return calculation I introduced last time, this amount will be

Am = P・∏ (j=1->n) exp(Rj),

where ∏ is the symbol for multiplying elements over the range of indices 1 ≤ j ≤ n. The Rj are the interest rates which will be assumed to be normally distributed with mean M and variance V. Furthermore, let Rj = M + R'j, where the mean of R'j is zero (but still with variance V. We can then write

Am = exp(nM)・∏ (j=1->n)exp(R'j).

Note that nM = interest rate over the total time and exp(nM) = total return.

Now what we need to derive is the expected value of Am, or A'm = Am/P for convenience

<A'm> = exp(nM) <∏ (j=1->n)exp(R'j)>.

Note that if the interest rates are constant and equal to M, we get A'm = exp(nM) as we should. Assuming R'j << 1, we can write

<∏ (j=1->n)exp(R'j)> = <∏ (j=1->n)(1+R'j+R'j^2/2 + ...)>, using the Taylor expansion of the exponential. This can also be written

<(1+R'1+(R'1^2)/2)(1+R'2+(R'2^2)/2) ... (1+R'n+(R'n^2)/2)>.

Multiplying this out and keeping only quadratic terms <R'j・R'j> = V (remember R'j has mean = 0) and noting that the random terms are uncorrelated so that <R'j・R'k> = 0 for J≠k, we end up with

<∏ (j=1->n)exp(R'j)> = 1 + (m/2)V so that

<A'm> = exp(nM)・(1+mV/2).

This shows that, for interest rates Rj with a variance V, the expected value of the mean is biased upward. For your example with P = 10000, m = 5, M = 0.005 and V = 3x10^-4, the expected value is

<Am> = 10260, which is slightly greater than the 10254 you calculated using the average M. As can be seen, the bias in Am increasing with the number of periods m.

Because we are dealing with random numbers and a limited number of samples, the actual value of Am will be variable, but this estimate of the bias should help in predicting errors. There is also a little bias in using the exponential approximation, but it is on the order of the approximations made above. All this can be redone using the actual, discrete formulation you are used to.


---------- FOLLOW-UP ----------

QUESTION: Wow, that's what I'm talking about! It appears to be exactly what I need. You mentioned that "all this can be redone using the actual, discrete formulation you are used to."

Is  <A'm> = exp(nM)・(1+mV/2) the final formula? You state that m = periods, M = average interest rate, and V accounts for the variance. What exactly does exp(nM) represent? Earlier you wrote that exp(nM) represents total return, but we don't know the total return until the ending balance is

Thanks again,

Glad to hear back from you and glad you find the results applicable.

Yes, <A'm> = exp(nM)・(1+mV/2) is the final formula. Actually, I unintentionally switched the notation n and m in the middle there, but it shouldn't affect the result: both n and m represent the number of compounding periods in the calculation so that the final formula, using just m to denote the number of periods is

<A'm> = exp(mM)・(1+mV/2).

I really hope this doesn't confuse you, consider it just a typo.

The expression exp(mM) = exp(nM) = the total return if the interest rate for each period is constant and equal to its mean M (like the 0.005 in your example). This is actually stated in the explanation above, so this is just to make extra sure its understood. The point here is that this mean total return is increased by (1+mV/2) when the interest rates become random. (This is reminiscent of a random walk problem).

This estimate of the bias is about the best you can do for uncorrelated interest rates (an estimate of the variance of this estimate is possible but it will be relatively small and probably not worth worrying about). If the interest rates are corrlelated between componding periods, then the bias will be smaller (for a given total length of time). This could be formally estimated as per above but my suggestion, for a real world application, would be to just use a compounding period that is long enough so that the rates become essentially uncorrelated. For example, if you want to estimate the total return (with variable interest rates) over weeks, then you wouldn't necessarily need (or want) to use daily compounding if you know the rates become uncorrelaled over, say, a week. Then use a week for the compounding period. In case your wondering, compounding at different periods doesn't make all that much difference if it is significantly less than the total period.

Hope this helps. Send me another problem!


Advanced Math

All Answers

Answers by Expert:

Ask Experts


randy patton


college mathematics, applied math, advanced calculus, complex analysis, linear and abstract algebra, probability theory, signal processing, undergraduate physics, physical oceanography


26 years as a professional scientist conducting academic quality research on mostly classified projects involving math/physics modeling and simulation, data analysis and signal processing, instrument development; often ocean related

J. Physical Oceanography, 1984 "A Numerical Model for Low-Frequency Equatorial Dynamics", with M. Cane

M.S. MIT Physical Oceanography, B.S. UC Berkeley Applied Math

Past/Present Clients
Also an Expert in Oceanography

©2017 All rights reserved.

[an error occurred while processing this directive]