Skip to content

A C library to compute self-similar sequences and to estimate the Hurst parameter.

License

Notifications You must be signed in to change notification settings

diogo-fernan/testh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TestH is now mantained at https://github.com/cdgramos/testh. Also check out https://cdgramos.github.io/testh/ for more information.

TestH

TestH is an ANSI C library implementing several pseudo-random number generators (PRNGs) for self-similar sequences and several Hurst parameter estimators (also known as the Hurst exponent) described in the literature. It is an on-going research and development project, whose main objective is to provide researchers with the means to estimate the Hurst parameter and to generate sequences with the self-similarity property embedded in the data. It represents an effort to integrate the different methods in a normalized and comprehensive manner in a single software package, which is not found in other tools.

TestH provides a friendly API that allows writing customized programs with ease and few programming skills. The library provides generic methods to instantiate processes (by means of any of the generators or by reading data files), compute statistical information, and submit the processes to estimators of the Hurst parameter while pretty-printing the output.

TestH has been written for researchers and for research purposes. With that in mind, the library can be used in a wide array of research fields.

Minimal Working Example

Below is a minimal working example showing a fractional Brownian motion (fBm) process being generated with a pre-defined target Hurst parameter, which is then transformed to a fractional Gaussian noise (fGn) process. Afterwards, the aggregate processes that are needed by the procedure to estimate the Hurst parameter are computed and finally the Variance Time (VT) method is called upon.

#include "process.h"
#include "generators.h"
#include "estimators.h"
#include "io.h"

// fBm-SGA
#define N		100000
#define H		(double) 0.80
#define S		16

int main (void) {
  TestHVerbosity = TestH_HIGH;

  proc_Process *proc = gen_fBmSequentialGenerationAlgorithm (N, H, S, TestH_fBm);
  proc_FractionalGaussianNoise (proc);
  
  proc_ScalesConfig *conf = proc_CreateScalesConfig (TestH_POW, 7, 11, 2);
  proc_CreateScales (proc, conf);
  proc_PrintProcess (proc);
  
  est_VarianceTime (proc);
  
  proc_DeleteProcess (proc);
  io_PrintDone ();
  return EXIT_SUCCESS;
}

Dependencies and Usage

A Makefile is used to define dependencies and linkages of the library at compile time. The file src/test.c provides several usage examples of the library and contains the main function of a program that can be modified as one sees fit.

The object creation output and the binary output of the compilation, as defined in the Makefile, is respectively the following:

  • src/obj/; and
  • bin/test.

The following command needs to be issued at a command line whose current working directory is src/ in order to compile and run the program:

  • make clean; make; make run.

References and Materials

For detailed information about TestH, please refer to the following publications:

For a more detailed insight about self-similarity and the Hurst Parameter, please consider the following references:

Author

@dfernan__

About

A C library to compute self-similar sequences and to estimate the Hurst parameter.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published