Financial Simulator, Annual Version

In this post, we discuss a version of this financial simulator for annual data. In the last post, we discussed its currently published monthly version. This is a simplified version based on work by Angel Piotrowski. Here we do not have any bond rates or spreads, any earnings or dividends. We have only annual volatility, previously computed by Angel, and total returns data, available on my web page. The code and data are also available on GitHub/asarantsev repository annual-simulator.

We have log Heston model for annual volatility  V(t) :

 \ln V(t) = \alpha + \beta \ln V(t-1) + W(t),\quad \beta = 0.62,\quad \alpha = 0.848.

Here, we can model  W(t) as IID, judging by the ACF plot for  W(t) and the ACF plot for  |W(t)|.

It turns out we cannot quite model  W(t) by a normal distribution. But it is quite close. See also the table below. This is quite weak evidence of normality! Next, we model total (including dividends) real (inflation-adjusted) returns  Q(t) as follows:  Q(t) = V(t)Z(t) for  Z(t) IID Gaussian:

These normalized returns  Z(t) are very well modeled by IID Gaussian. This is confirmed by the plots above. Similar plots are found for the nominal versions of returns.

DataSkewness (normal =0)Kurtosis (normal = 0)Shapiro-Wilk  p Jarque-Bera  p
AR(1) Innovations for Log Volatility0.590.0570.94%6.1%
Normalized Total Nominal Returns0.22-0.2111%60%
Normalized Total
Real Returns
0.240.02320%63%

We model  (Z(t), W(t)) as bivariate normal IID:  \mathcal N_2(\mu, \Sigma). We found the mean vector and the covariance matrix, for both real and nominal versions. This is available when we run the code.

Next, the code has a function which simulates 1000 paths of wealth:

 \mathcal W(t) = \mathcal W(0)\exp(Q(1)+\ldots +Q(t))

for  t = 0, \ldots, T. This formula would be true for the case when there are no contributions or withdrawals. If each year we have flow (inflow or outflow)  F(t) (positive or negative), then the wealth process is

 \mathcal W(t) = \mathcal W(t-1)e^{Q(t)} - F(t)

The arguments of this function are:

  1. Choose: Real or Nominal?
  2. initial wealth  \mathcal W(0)
  3. flow  F(t) each year
  4. time horizon  T in years
  5. initial volatility  V(0)

We rank 1000 simulations by final wealth. This is the same ranking as by average total returns, if only we have no contributions or withdrawals. But if we do have inflows or outflows every year, then these rankings by wealth vs by returns might be different. For each paths, we compute average total returns  (Q(1) + \ldots + Q(T))/T.

We pick simulations corresponding to 10%, 30%, 50%, 70%, 90% ranking of final wealth. We chose these because it gives us more or less comprehensive picture of randomness. It is trivial but often neglected that markets have a lot of volatility. It is not enough to provide mean or median returns or wealth. We need the entire distribution.

One could suggest a histogram of final wealth. But a histogram is hard to read by ordinary users. Also, it shows less information than wealth paths. To laypeople, wealth paths fluctuate wildly, and the path which are on top now can drop fast later. But the histogram does not show that.

Why choose these 5 quantiles? We need to show the median (typical wealth) and the outliers. But one should not go too far. Showing the path corresponding to the maximal or minimal final wealth would give a distorted picture: Users might misunderstand these and think that such outcomes are typical. Even showing the paths corresponding to 5% or 95% final wealth are not very typical: These are outliers, atypical outcomes.

The range of 10%, 30%, 50%, 70%, 90% shows full range of outcomes, but only typical outcomes, not outliers.

We also stress that average final wealth does not mean we exceed this wealth in 50% of simulations. The distribution of the final wealth is much skewed, so mean and median are not the same!

Note than in case of withdrawals, the path might end in ruin (bankruptcy; zero wealth). If some of the chosen five paths has this, we show this and we do not compute average total returns. We also compute average total returns for paths which do not end up in ruin.

We compute how many paths end in ruin, thus the empirical probability of ruin. This is a major problem in retirement planning: How much can we withdraw per year so that we do not end up in ruin? The classic withdrawal rate is 4% (of initial wealth) per year, if we adjust these withdrawals for inflation.

We adapted the Python code for running locally, so it contains a function which makes this plot below. This is quite different from the Python code in the simulator, which includes entering data from a web page and putting the output using this web page. We also have HTML code for this web page. For running this Python code locally, obviously we do not need this HTML page, only the Python code itself.

Interestingly, even gigantic 7.5% annual withdrawal rate within 20 years results in only 10.5% ruin probability! Our analysis shows we can be much more permissive with withdrawals than the classic 4% rule.

Published by


Responses

  1. S&P 500 Returns using Earnings Yield & Volatility – My Finance

    […] the previous blog post, I have written about the simulator using only one factor: annual volatility, and two equations: for volatility and for total returns. […]

    Like

  2. S&P 500 Annual Returns with CAPE and Volatility – My Finance

    […] is yet another version of the financial simulator. See my GitHub/asarantsev repository […]

    Like

  3. Combined Simulator of Annual S&P Returns vs Volatility + (maybe) Earnings Yield – My Finance

    […] research continues blog posts on modeling returns vs earnings yield and volatility and returns vs only volatility. But previous Python code combines fitting of this model and simulation. Here, we removed plots […]

    Like

  4. Simulator of S&P Returns using volatility only or with Shiller CAPE – My Finance

    […] Annual realized volatility only, computed by my undergraduate student Angel Piotrowski […]

    Like

  5. S&P Returns vs 3 Spreads with Volatility – My Finance

    […] plan later to add the entire simulator for the rates-only model (with annual volatility, of course). Below we show one simulated path of […]

    Like

  6. Simulators – My Finance

    […] only, see this blog post and GitHub […]

    Like

  7. To Do List – My Finance

    […] both large stock returns and corporate bond returns. Previously, we modeled large stock returns (measured by S&P) using annual volatility and the new valuation measure. We also used bond spreads but not rates, […]

    Like

Leave a comment