# Literature on generating synthetic time series for testing

I have some market data (daily time series) for bond prices and CDS indices and I would like to generate synthetic versions of these which are statistically "similar" for testing trading strategies. Is there literature on this subject?

• We had another question about synthetic data a few weeks ago, but it doesn't seem to have gone very far. The correlations in historical data that traders rely on are very difficult to reproduce. Commented Sep 5, 2011 at 19:19
• @chrisaycock the previous question was about FX tick data simulation, bonds and CDS at a daily frequency is a completely different question. Commented Sep 5, 2011 at 23:50

Yes, there is in fact a whole literature on this subject coming from the field of non-linear dynamics-- it is known as the method of surrogates. The idea is essentially to come up with a "scrambled" version of your original data set that preserves many of the basic statistical properties, though perhaps not the serial dependence structure which might be important for your purposes. I think the best way to do this is to apply a Fourier transform to your data to re-express it in the frequency domain, and then randomly shuffle the data in that form, then convert back by applying the inverse transformation. This Matlab code from the FileExchange does exactly that:

http://www.mathworks.com/matlabcentral/fileexchange/32621-phase-randomization/content/phaseran.m

The easiest answer which comes to my mind is generating correlated time series.

There is a good description of the process in Part 3 of this document :

http://www.columbia.edu/~mh2078/MCS04/MCS_framework_FEegs.pdf

If you base your correlation input on the correlation observed in the market data you should obtain "statistically" similar time series.

• Thanks for the answer. I was actually hoping there would be a way of manipulating the market data that I have in a deterministic way (such as, say, taking the first difference between consecutive values and swapping these around) rather than extracting statistical information about the time series e.g. autocorrelation and then generating a new random variables etc. to get a new time series. Commented Sep 6, 2011 at 7:33
• That would be overfitting, you need to generate new random variables imho Commented Sep 6, 2011 at 8:09

In response to this question, I posted an answer which in turn links to a post on my blog which uses the Fast Fourier Transform to create synthetic prices, in a similar vein to the code linked to in Doodles' answer above. The example screen shots in my blog post show terminal output which indicate high statistical similarity between the original time series and the synthetic series generated from it.