Quantcast aiQUANT » 2008 » February » 03

Archive for February 3rd, 2008

Wavelet textbooks

Signal Processing, Wavelet Transform 2 Comments »

I wish to start discussing wavelets, which is yet another branch of signal processing that has had success in feature extraction and volatility forecasting for time series. I suggest the following three excellent books for the reader who is interested in wavelets:

Additionally there are numerous web resources on wavelets and the like, with about two million hits via google search.

Using Simulink to implement and test models

Hilbert Transform, Matlab, Signal Processing, Transform Algebra 4 Comments »

In addition to Matlab, The Mathworks offer a product called Simulink which is a design platform for implementing and testing model-based systems. Most of my experience using Simulink borders on modelling Control Systems and DSP architectures. However, as the Mathworks have pointed out in a recent webinar, Simulink can be extended to develop and test finance based models such as a trading system or sub-systems that form part of a larger model.

I decided to implemented a Hilbert Transformer model for price data using Simulink which is shown below:

HilbertDiagram.jpg

The model has input “simin” which takes the price data from the matlab workspace as discrete points one at a time and applies unit delay (represented by “1/Z”) and gain which is basically multiplication by the shown number. Individual Real and Complex parts are combined to create complex numbers which is then outputted to the workspace.

Simply put, the Hilbert Transform converts price data into complex number form so that one may go about calculating different measures that are not possible to calculate using just the price itself. My previous post mentions measures that are calculated using hilbert transformed price. The relationship between the actual price and the hilbert transformed price is

\small \text{Actual Price = sqrt{a^2 + b^2}} for a hilbert price \small\text{a + ib}.

As one would expect the model implemented above suffers lag. This is confirmed by comparing the Actual price with the price reconstructed from the hilbert complex numbers:

HilbertSimulinkModel.png

The model does not induce any loss or gain in magnitude, but there is a lag of 4 bars. This implies that the hilbert price for the current bar actually corresponds to the price 4 bars ago - something we should consider when using hilbert prices to deduce other measures.

Other Links:

  1. The wikipedia page covers basics of the hilbert transform.
  2. The Mathworks have a webinar which has a section on using Simulink for designing and testing Algorithmic Trading models. You can view this webinar here. Its round about 40:00mins into the presentation where the section on Simulink begins.
  3. Simulink totorial can be found here.
  4. There a number of webinars and example models at the Mathworks website for one to get started using simulink.
Close
E-mail It