[R-SIG-Finance] Simulate the stock market for back testing strategy
Brian G. Peterson
brian at braverock.com
Fri Feb 8 16:01:45 CET 2008
elton wang wrote:
> Here is a beginner question:
> what would be your perferred method if we want to
> simulate the stock market for back testing a trading
> strategy?
> Using sp500 daily data as example, if given the
> knowledge that historical data has time varying
> volatility, autocorrelations etc? just fitting a
> GARCH(1,1) or doing historical resampling? (simply
> divided the data to in-sample and out sample may not
> be sufficient, am I right?)
You've bitten off one of the most complex and studied problems in finance.
Kalman filtering is often applied to build bands and trends, as are
straightforward standard deviation based measures such as "Bollinger bands".
Any of the AR methods ARMA, ARIMA, GARCH allow for time-varying changes
in level and volatility.
Refinement of those models generally involves EMM or Bayesian evolution
of the moments.
These can all be used as one- or multiple- step-ahead prediction methods.
In general, these predictions would be used as inputs to *create* a
trading strategy. You would then backtest your strategy by setting up a
"learning period" (length depending on the frequency of your data), and
then letting the model evolve on an out-of-sample basis (by making one
step ahead or similar predictions).
If you then wanted to further test your models, you could fit various
distributions to historical data and simulate historical series from
these distributions. I'm not really a fan of the pure simulation
approach unless you are very careful and know what you're doing, because
there is a huge amount of model risk (risk that you will mis-specify
starting parameters and therefore get worthless results) involved in
these pure simulation approaches.
Many Bayesian (and other Monte Carlo) methods use simulation to inform
their predictions, but this is different than constructing purely
hypothetical historical series to test a model against.
Regards,
- Brian
More information about the R-SIG-Finance
mailing list