RQA metrics

C/C++

void accrqa_print_error(Accrqa_Error *error)

Prints error messages associated with error status.

Parameters:

error – Error status to print.

void accrqa_version()

Prints accrqa version.

void accrqa_LAM(float *output, float *input_data, size_t data_size, int *tau_values, int nTaus, int *emb_values, int nEmbs, int *vmin_values, int nVmins, float *threshold_values, int nThresholds, Accrqa_Distance distance_type, int calc_ENTR, Accrqa_CompPlatform comp_platform, Accrqa_Error *error)

Calculates LAM, TT, TTmax, ENTR and RR RQA metrics from supplied time-series. (float)

Array dimensions are as follows, from slowest to fastest varying:

  • output is 3D data cube containing RR values, with shape:

    • [ nTaus, nEmbs, nLmins, nThresholds , 5 ].

  • input_data is 1D and real-valued, with shape:

    • [ data_size ]

  • tau_values is 1D and integer-valued, with shape:

    • [ nTaus ]

  • emb_values is 1D and integer-valued, with shape:

    • [ nEmbs ]

  • lmin_values is 1D and integer-valued, with shape:

    • [ nEmbs ]

  • threshold_values is 1D and real-valued, with shape:

    • [ nThresholds ]

Parameters:
  • output – Multi-dimensional data cube containing RR values.

  • input_data – Real-valued array of input time-series samples.

  • data_size – Number of samples (float) of the time-series.

  • tau_values – Integer array of delay values.

  • nTaus – Number of delays.

  • emb_values – Integer array of embedding values.

  • nEmbs – Number of embeddings.

  • vmin_values – Integer array of minimal lengths values.

  • nVmins – Number of minimal lengths.

  • threshold_values – Real-valued array (float) of threshold values.

  • nThresholds – Number of threshold values.

  • distance_type – Distance formula used in calculation of distance to the line of identity.

  • calc_ENTR – Turns calculation of ENTR on (1) and off (0).

  • comp_platform – Compute platform to use.

  • error – Error status.

void accrqa_LAM(double *output, double *input_data, size_t data_size, int *tau_values, int nTaus, int *emb_values, int nEmbs, int *vmin_values, int nVmins, double *threshold_values, int nThresholds, Accrqa_Distance distance_type, int calc_ENTR, Accrqa_CompPlatform comp_platform, Accrqa_Error *error)

Calculates LAM, TT, TTmax, ENTR and RR RQA metrics from supplied time-series. (double)

Array dimensions are as follows, from slowest to fastest varying:

  • output is 3D data cube containing RR values, with shape:

    • [ nTaus, nEmbs, nLmins, nThresholds , 5 ].

  • input_data is 1D and real-valued, with shape:

    • [ data_size ]

  • tau_values is 1D and integer-valued, with shape:

    • [ nTaus ]

  • emb_values is 1D and integer-valued, with shape:

    • [ nEmbs ]

  • lmin_values is 1D and integer-valued, with shape:

    • [ nEmbs ]

  • threshold_values is 1D and real-valued, with shape:

    • [ nThresholds ]

Parameters:
  • output – Multi-dimensional data cube containing RR values.

  • input_data – Real-valued array of input time-series samples.

  • data_size – Number of samples (double) of the time-series.

  • tau_values – Integer array of delay values.

  • nTaus – Number of delays.

  • emb_values – Integer array of embedding values.

  • nEmbs – Number of embeddings.

  • vmin_values – Integer array of minimal lengths values.

  • nVmins – Number of minimal lengths.

  • threshold_values – Real-valued array (double) of threshold values.

  • nThresholds – Number of threshold values.

  • distance_type – Distance formula used in calculation of distance to the line of identity.

  • calc_ENTR – Turns calculation of ENTR on (1) and off (0).

  • comp_platform – Compute platform to use.

  • error – Error status.

int accrqa_LAM_output_size_in_elements(int nTaus, int nEmbs, int nVmins, int nThresholds)

Calculates size of LAM output array in number of elements.

Parameters:
  • nTaus – Number of delays.

  • nEmbs – Number of embeddings.

  • nVmins – Number of minimal lengths.

  • nThresholds – Number of threshold values.

void accrqa_DET(float *output, float *input_data, size_t data_size, int *tau_values, int nTaus, int *emb_values, int nEmbs, int *lmin_values, int nLmins, float *threshold_values, int nThresholds, Accrqa_Distance distance_type, int calc_ENTR, Accrqa_CompPlatform comp_platform, Accrqa_Error *error)

Calculates DET, L, Lmax, ENTR and RR RQA metrics from supplied time-series. (float)

Array dimensions are as follows, from slowest to fastest varying:

  • output is 3D data cube containing RR values, with shape:

    • [ nTaus, nEmbs, nLmins, nThresholds , 5 ].

  • input_data is 1D and real-valued, with shape:

    • [ data_size ]

  • tau_values is 1D and integer-valued, with shape:

    • [ nTaus ]

  • emb_values is 1D and integer-valued, with shape:

    • [ nEmbs ]

  • lmin_values is 1D and integer-valued, with shape:

    • [ nEmbs ]

  • threshold_values is 1D and real-valued, with shape:

    • [ nThresholds ]

Parameters:
  • output – Multi-dimensional data cube containing RR values.

  • input_data – Real-valued array of input time-series samples.

  • data_size – Number of samples (float) of the time-series.

  • tau_values – Integer array of delay values.

  • nTaus – Number of delays.

  • emb_values – Integer array of embedding values.

  • nEmbs – Number of embeddings.

  • lmin_values – Integer array of minimal lengths values.

  • nLmins – Number of minimal lengths.

  • threshold_values – Real-valued array (float) of threshold values.

  • nThresholds – Number of threshold values.

  • distance_type – Distance formula used in calculation of distance to the line of identity.

  • calc_ENTR – Turns calculation of ENTR on (1) and off (0).

  • comp_platform – Compute platform to use.

  • error – Error status.

void accrqa_DET(double *output, double *input_data, size_t data_size, int *tau_values, int nTaus, int *emb_values, int nEmbs, int *lmin_values, int nLmins, double *threshold_values, int nThresholds, Accrqa_Distance distance_type, int calc_ENTR, Accrqa_CompPlatform comp_platform, Accrqa_Error *error)

Calculates DET, L, Lmax, ENTR and RR RQA metrics from supplied time-series. (double)

Array dimensions are as follows, from slowest to fastest varying:

  • output is 3D data cube containing RR values, with shape:

    • [ nTaus, nEmbs, nLmins, nThresholds , 5 ].

  • input_data is 1D and real-valued, with shape:

    • [ data_size ]

  • tau_values is 1D and integer-valued, with shape:

    • [ nTaus ]

  • emb_values is 1D and integer-valued, with shape:

    • [ nEmbs ]

  • lmin_values is 1D and integer-valued, with shape:

    • [ nEmbs ]

  • threshold_values is 1D and real-valued, with shape:

    • [ nThresholds ]

Parameters:
  • output – Multi-dimensional data cube containing RR values.

  • input_data – Real-valued array of input time-series samples.

  • data_size – Number of samples (double) of the time-series.

  • tau_values – Integer array of delay values.

  • nTaus – Number of delays.

  • emb_values – Integer array of embedding values.

  • nEmbs – Number of embeddings.

  • lmin_values – Integer array of minimal lengths values.

  • nLmins – Number of minimal lengths.

  • threshold_values – Real-valued array (double) of threshold values.

  • nThresholds – Number of threshold values.

  • distance_type – Distance formula used in calculation of distance to the line of identity.

  • calc_ENTR – Turns calculation of ENTR on (1) and off (0).

  • comp_platform – Compute platform to use.

  • error – Error status.

int accrqa_DET_output_size_in_elements(int nTaus, int nEmbs, int nLmins, int nThresholds)

Calculates size of DET output array in number of elements.

Parameters:
  • nTaus – Number of delays.

  • nEmbs – Number of embeddings.

  • nLmins – Number of minimal lengths.

  • nThresholds – Number of threshold values.

void accrqa_RR(float *output, float *input_data, size_t data_size, int *tau_values, int nTaus, int *emb_values, int nEmbs, float *threshold_values, int nThresholds, Accrqa_Distance distance_type, Accrqa_CompPlatform comp_platform, Accrqa_Error *error)

Calculates RR RQA metric from supplied time-series. (float)

Array dimensions are as follows, from slowest to fastest varying:

  • output is 3D data cube containing RR values, with shape:

    • [ nTaus, nEmbs, nThresholds ].

  • input_data is 1D and real-valued, with shape:

    • [ data_size ]

  • tau_values is 1D and integer-valued, with shape:

    • [ nTaus ]

  • emb_values is 1D and integer-valued, with shape:

    • [ nEmbs ]

  • threshold_values is 1D and real-valued, with shape:

    • [ nThresholds ]

Parameters:
  • output – Multi-dimensional data cube containing RR values.

  • input_data – Real-valued array of input time-series samples.

  • data_size – Number of samples (float) of the time-series.

  • tau_values – Integer array of delay values.

  • nTaus – Number of delays.

  • emb_values – Integer array of embedding values.

  • nEmbs – Number of embeddings.

  • threshold_values – Real-valued array (float) of threshold values.

  • nThresholds – Number of threshold values.

  • distance_type – Distance formula used in calculation of distance to the line of identity.

  • comp_platform – Compute platform to use.

  • error – Error status.

void accrqa_RR(double *output, double *input_data, size_t data_size, int *tau_values, int nTaus, int *emb_values, int nEmbs, double *threshold_values, int nThresholds, Accrqa_Distance distance_type, Accrqa_CompPlatform comp_platform, Accrqa_Error *error)

Calculates RR RQA metric from supplied time-series. (double)

Array dimensions are as follows, from slowest to fastest varying:

  • output is 3D data cube containing RR values, with shape:

    • [ nTaus, nEmbs, nThresholds ].

  • input_data is 1D and real-valued, with shape:

    • [ data_size ]

  • tau_values is 1D and integer-valued, with shape:

    • [ nTaus ]

  • emb_values is 1D and integer-valued, with shape:

    • [ nEmbs ]

  • threshold_values is 1D and real-valued, with shape:

    • [ nThresholds ]

Parameters:
  • output – Multi-dimensional data cube containing RR values.

  • input_data – Real-valued array of input time-series samples.

  • data_size – Number of samples (double) of the time-series.

  • tau_values – Integer array of delay values.

  • nTaus – Number of delays.

  • emb_values – Integer array of embedding values.

  • nEmbs – Number of embeddings.

  • threshold_values – Real-valued array (double) of threshold values.

  • nThresholds – Number of threshold values.

  • distance_type – Distance formula used in calculation of distance to the line of identity.

  • comp_platform – Compute platform to use.

  • error – Error status.

int accrqa_RR_output_size_in_elements(int nTaus, int nEmbs, int nThresholds)

Calculates size of RR output array in number of elements.

Parameters:
  • nTaus – Number of delays.

  • nEmbs – Number of embeddings.

  • nThresholds – Number of threshold values.

Python

accrqa.RR(input_data, tau_values, emb_values, threshold_values, distance_type, comp_platform='nv_gpu', tidy_data=False)

Calculates RR metric from supplied time-series. https://en.wikipedia.org/wiki/Recurrence_quantification_analysis

Parameters:
  • input_data – The input time-series.

  • tau_values – Array of delays.

  • emb_values – Array of embedding values.

  • threshold_values – Array of threshold values.

  • distance_type – Type of formula used to calculate distance to line of identity.

  • comp_platform – [Optional] Computational platform to be used. Default is cpu.

  • tidy_data – [Optional] Output data in tidy data format. Requires pandas.

Returns:

A numpy NDArray containing of RR values with dimensions [number of delays, number of embeddings, number of thresholds].

Raises:
  • TypeError – If number of delays, embedding or thresholds is zero length.

  • TypeError – If input_data is not numpy.ndarray.

  • TypeError – If wrong type of the distance to the line of identity is selected.

  • TypeError – If wrong computational platform is selected.

  • RuntimeError – If AccRQA library encounters a problem.

accrqa.LAM(input_data, tau_values, emb_values, vmin_values, threshold_values, distance_type, calculate_ENTR, comp_platform='nv_gpu', tidy_data=False)

Calculates DET, L, Lmax, ENTR and RR metrics from supplied time-series. https://en.wikipedia.org/wiki/Recurrence_quantification_analysis

Parameters:
  • input_data – The input time-series.

  • tau_values – Array of delays.

  • emb_values – Array of embedding values.

  • vmin_values – Array of minimal lengths.

  • threshold_values – Array of threshold values.

  • distance_type – Type of formula used to calculate distance to line of identity.

  • comp_platform – [Optional] Computational platform to be used. Default is cpu.

  • tidy_data – [Optional] Output data in tidy data format. Requires pandas.

Returns:

A numpy NDArray containing of RR values with dimensions [number of delays, number of embeddings, number of thresholds].

Raises:
  • TypeError – If number of delays, embedding, minimal lengths or thresholds is zero length.

  • TypeError – If input_data is not numpy.ndarray.

  • TypeError – If wrong type of the distance to the line of identity is selected.

  • TypeError – If wrong computational platform is selected.

  • RuntimeError – If AccRQA library encounters a problem.

accrqa.DET(input_data, tau_values, emb_values, lmin_values, threshold_values, distance_type, calculate_ENTR, comp_platform='nv_gpu', tidy_data=False)

Calculates DET, L, Lmax, ENTR and RR metrics from supplied time-series. https://en.wikipedia.org/wiki/Recurrence_quantification_analysis

Parameters:
  • input_data – The input time-series.

  • tau_values – Array of delays.

  • emb_values – Array of embedding values.

  • lmin_values – Array of minimal lengths.

  • threshold_values – Array of threshold values.

  • distance_type – Type of formula used to calculate distance to line of identity.

  • comp_platform – [Optional] Computational platform to be used. Default is cpu.

  • tidy_data – [Optional] Output data in tidy data format. Requires pandas.

Returns:

A numpy NDArray containing of RR values with dimensions [number of delays, number of embeddings, number of thresholds].

Raises:
  • TypeError – If number of delays, embedding, minimal lengths or thresholds is zero length.

  • TypeError – If input_data is not numpy.ndarray.

  • TypeError – If wrong type of the distance to the line of identity is selected.

  • TypeError – If wrong computational platform is selected.

  • RuntimeError – If AccRQA library encounters a problem.

R