Functions

src/recurrence_plot.c File Reference

#include "recurrence_plot.h"

Go to the source code of this file.

Functions

Arrayrecplot (const Array *s1, const Array *s2, Array *out, double epsilon, OptArgList *optargs)
 Calculate a (cross-)recurrence plot.
double * recplot_calculate_epsilons (Array *s1, Array *s2, double *eps, int fan)
 calculate epsilons for each i such that a fixed amount of neighbours is included.

Function Documentation

Array* recplot ( const Array s1,
const Array s2,
Array out,
double  epsilon,
OptArgList optargs 
)

Calculate a (cross-)recurrence plot.

Given the input multivariate time-series$\vec{s}_1(t)$ and$\vec{s}_2(t)$, calculate

\[ \vec{C}^{\vec{s}_1,\vec{s}_2}(t_1,t_2) = \Theta(\varepsilon - ||\vec{s}_1(t_1)-\vec{s}_2(t_2)||) \]

If$\vec{s}_1(t)=\vec{s}_2(t)$, it is a usual recurrence-plot, else it is a cross-recurrence plot (CRP).

Parameters:
s1,s2 (multivariate) signals used to construct the recurrence plot (1D or 2D arrays)
out the recurrence plot or NULL -> memory is alloc'ed; for convenience, the recurrence plot is a double-matrix
epsilon; either a number given a fixed criterion for the distance between points in phase space or: a fixed amount of nearest neighbours, if flags contains RPLOT_FAN
optargs may contain:

  • fan=int flag, whether to use a "fixed-amount of nearest neighbours" instead of the epsilon-ball. In this case, the epsilon argument is ignored
  • optargs for the distance-function (optargs is passed 'as is' to this function)
Returns:
out (an N x N double matrix)

Definition at line 51 of file recurrence_plot.c.

double* recplot_calculate_epsilons ( Array s1,
Array s2,
double *  eps,
int  fan 
)

calculate epsilons for each i such that a fixed amount of neighbours is included.

Currently it takes O(n^2) but could probably be done faster.

Parameters:
s1 2D-array (matrix), N x p
s2 2D-array (matrix), N x p
eps N-doubles or NULL
fan number of neighbours
Returns:
eps (N doubles)

Definition at line 130 of file recurrence_plot.c.