Hilbert transformation

Hilbert transformation is another technique to transform time series and R uses the seewave package for this. This package can be installed using install.packages() and loaded into the workspace using the library() command:

> model <-  hilbert(dji, 1) 

The first parameter is the time series object which you would like to transform, and the second parameter is the sampling frequency of the wave. In the preceding example, I used dji as time series and sampling frequency as 1 to calculate the Hilbert transformation.

If you would like to know the output of the model then you should use the following code:

> summary(model) 
      V1          
 Length:2555 
 Class :complex 
 Mode  :complex 

The preceding output mentions the length of input data series is ...

Get Learning Quantitative Finance with R now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.