Monte Carlo higher precision

What does a higher precision simulation do differently than standard precision?


It has to do with how the monte carlo works. Basically it calculates a consumption function that is a n dimensional grid with the axes being various values of the state variables (regular assets and retirement accounts) with a consumption value for that point. Since storage is limited, the grid is understandably pretty coarse and the possible range of the various state variables are fixed. Every time a a consumption is needed, the code interpolates the actual value since relatively few times are the values of the state variables exact matches for the values used to calculate the consumption function. The interpolation used is a linear interpolation which actually isn't a particularly good match for the actual shape of the consumption function in between points but is the best that can be done because the actual shape of the consumption function cannot be predicted given the current state of the art.. The higher precision effectively makes the shape of the consumption function in between points "closer" to linear, allowing the interpolation to be more exact.

The trade off is that it is an n**2 problem. For each doubling of precision you need n**2 more time to calculate the consumption function.

So, more precision, more time. We actually implemented another doubling on top of what we call "higher" precision but the time to actually run the MC became nearly geologic (hours) and we felt that was not viable in a desktop product.

Probably too much information, but...


Dick Munroe

By the way, we discussed some time ago in another thread ("Monte Carlo for inflation") about a "Cray" version of ESP. The precision option you implemented is a step in the right direction of giving the user the option. So kudos again. My two-year old system runs the high-precision in just under 14 minutes. I'm not sure what I'd get for the next doubling, unless we added another state variable, but next time I upgrade to a new system I'll be asking about it. :)

On the order of 3+ hours, minimum.


Dick Munroe

It's not the number of iterations (economic lives lived) that drives the memory requirements (although that does have a linear relationship to it).

The driving force is the number of state variables and the size of the arrays necessary to hold the "function" for the various values of the state variables.

So, given that we have 3 state variables (regular asset, husband's retirement assets, wife's retirement assets), consider standard precision to have a value of 1 for each of these state variables and the amount of memory required is the product of the weights for each state variable or:

1 * 1 * 1 = 1

And this is the amount of memory that is required for "standard" precision.

Now, we have higher precision in which we double the weight associated with each state variable, now we get:

2 * 2 * 2 = 8

which is the increase in memory (and, unfortunately ALSO the approximate increase in compute time) for the higher precision.

The number of iterations (500) for each trajectory is a constant that gets carried along because we need to have a "bunch" of trajectories calculated so that we can show the variance.

In both cases, standard and higher, the same number of trajectories are calculated (economic lives used). The difference is in the resolution of the consumption function where we can't solve the problem analytically but have to do a numerical approximation.

We could go higher in precision, but without either really exotic iron and boatloads of memory or an additional breakthrough in theory, the computations wouldn't complete in less than geologic time.

In computer science parlance, this computation is an n-squared computation, i.e., for each doubling in n, you need n-squared more space and/or time to perform the computation. If we could get it to be an n(log(n)) computation (which is the breakthrough in theory part) then we could get much more precision in a reasonable time and space.


Dick Munroe

We use cookies to deliver the best user experience and improve our site.