Examples

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 "proc.h"
#include "gen.h"
#include "est.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;
}


Usage example for estimating the self-similarity of a time series generated with the Hosking method for a given H value and N length, using the Rescaled Range Statistics (R/S).
#include "proc.h"
#include "gen.h"
#include "est.h"
#include "io.h"

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define N   pow(2,15)
#define H   (double) 0.25

int main (int argc, char *argv[]) {

    proc_Process *pr = gen_Hosking (N, H, TestH_fBm);

    proc_ScalesConfig *conf = proc_CreateScalesConfig (TestH_POW, 7, 11, 2);

    proc_CreateScales (pr, conf);

    est_RescaledRangeStatistics (pr);

    proc_DeleteProcess (pr);

    return 1;
}