Bayesian-lite Simulator

Finally, we have a long desired simulator for Bayesian-lite mode: coefficients from objective Bayes posterior and covariance matrix for innovations fixed. At first we did this only for one asset class: US stocks, and only one factor: volatility. Later, we do this for more asset classes, to complete this program. This is our main goal here.

We transformed the volatility using the Yeo-Johnson transform. We used the simplest model:

 \tilde{V}(t) = \alpha + \beta\tilde{V}(t-1) + W(t)

 Q(t) = a + bV(t) + V(t)Z(t)

where  V(t) = \exp(f(\tilde{V}(t))) and  f(v) is the inverse Yeo-Johnson transform.

We created a new repository. One Python file new-sim.py contains:

  • reading the data file
  • fitting regressions
  • extracting regression parameters
  • running the loop for 10000 simulations
  • analyzing results (text version of the graph)

A separate file bayesOLS.py contains objective Bayes simulation of regression parameters and simulation of noise terms, where we assume the standard error is constant. Finally, the inverse transform is coded in YJX.py.

We were very positively surprised that it takes such a short time. Only 10 seconds on my office computer. But the previous version without reading and fitting the data takes only 2 seconds on my office computer. Maybe we can multiply time by 5?

Published by


Leave a comment