TISEAN Package Porting Project
Goal of the project
The goal of this project is not to port the entire TISEAN package to octave. That would be a desired outcome though it might not be feasible within the time constraints. The goal of this project is to give the TISEAN package a solid start and to port as many functions as possible to create a solid foundation for the future.
As the TISEAN package consists of 74 programs I have divided the first part into three sub-parts:
- FORTRAN ones that can be re-implemented easily in m-files (a good example of such a program is 'henon') -- there are 5 programs in this class
- C programs which also need to be linked to oct files (an example is 'ghkss') -- there are 41 programs in this class
- FORTRAN ones that need to be linked to oct files (an example of such a program is 'project') -- there are 28 programs in this class
They are ordered so that according to my estimates the difficulty rises with the number. This is because typecasting and implicit typing (which is included in most of the FORTRAN files in the TISEAN library) can be problematic sometimes.
Apart from the qualitative division I propose a work oriented division. In it each subpart can be tackled separately and create an entity in-and-of-itself. I chose to work along the lines of the articles about implementations of nonlinear timeseries included in the documentation. This article discusses various algorithms and what certain programs mean. It can be found here. I will discuss in which order I would like to port various topics from this article and where my work currently stands.
Nonlinear noise reduction
This is the first topic I chose. It is because it contains programs from all three categories. It is also relatively small -- it contains 3 programs: project, lazy, ghkss. I have chosen to further implement addnoise and henon, to demonstrate how project and ghkss work. Thus this topic contains programs from each category:
- Re-implementable in mfile (henon)
- Linkable to FORTRAN (project, addnoise, lazy)
- Linkable to c (ghkss)
I have already started working on this stage. My progress can be viewed at https://bitbucket.org/josiah425/tisean. So far I have implemented addnoise, project and re-implemented henon as an mfile. As most work on this topic has been completed I estimate that finishing it up will take around 2 days -- throughout my outline I estimate about 1 day per program (that includes documentation and testing).
Phase space representation
This is the next topic that needs to be implemented. This is because it contains programs (especially 'delay') that are used to visualize data. Whenever an example is given in the package the resulting data is routed through 'delay' before it is plotted. Apart from delay it also contains other functions that can divided into the following categories:
- Linkable to FORTRAN (autocorr, pc)
- Linkable to c (delay, corr, mutual, false_nearest, pca)
Assuming around a day for each function (with testing and documenting the usage) I assume this stage will take a little over a week.
This seems like a reasonable next step. It consists of the following programs:
- Linkable to FORTRAN (predict, upo)
- Linkable to C (lzo-test, lzo-gm, lzo-run, lfo-ar, lfo-gm, lfo-run, rbf, polynom, xzero)
Again assuming around a day for each program (with testing, documenting usage and writing examples) I assume this stage will take about two weeks.
This stage will include:
- Linkable to C (lyap_r, lyap_k, lyap_spec)
It will take about 2-3 days to complete.
Dimensions and entropies
This topic is next on the list. Programs it include are as follows:
- Linkable to FORTRAN (c2naive, c2, c2t, c2d, c2g, c1)
- Linkable to C (d2, boxcount)
This stage should take little over a week. I expect this stage and the previous one to take about two weeks.
Testing for nonlinearity
This is the last topic I intend to tackle. The following programs are included here:
- Linkable to FORTAN (surrogates, randomize , timerev)
This stage should take me about 3 days to complete.
Notes on time estimates
Totaling up the above estimates it should take me 6 weeks to complete my task as outlined above.
My estimates might be high, but I believe it is more important to complete the task thoroughly than to port more programs haphazardly.
Details of work on each program
- FORTRAN linking
For each FORTRAN program that I intend to link to a oct-file I intend to:
- Strip the program of its input validation and transform it into a subroutine
- Create a .cc program (compiled into an oct-file) that will launch the stripped FORTRAN subroutine; this .cc program will also not contain input validation, it will be for internal use only
- Create a m-file that will perform input validation and launch the .cc and contain usage documentation
- C linking
I intend to do here something similar to the FORTRAN programs, although, it might be better to not create any extra m-files and incorporate the program's existing input validation into the .cc file. This might be a desired course of action. I will make a decision once I complete one such linking program.
- Reimplementing in mfile
This is quite straightforward, although it is important not to make a mistake while taking this approach.