Extract_from_RP#

Features#

Mode()#

Mode(array)[source]#

Function to compute mode from a continuous data

Parameters:

array (array) – a numpy array

Returns:

mode (double) – mode of continuous data

Check_Int_Array()#

Check_Int_Array(array)[source]#

This function checks whether an array consists of integers or not

Parameters:

array (array) – a numpy array

Returns:

status (bool) – whether the array is consisting only of integers(1) or not(0)

Sliding_window()#

Sliding_window(RP, maxsize, winsize)[source]#

This is a function that would extract RQA variables from each sliding window for a given RP and for a specified window size

Parameters:
  • RP (ndarray) – recurrence plot(numpy 2D matrix)

  • maxsize (int) – size of the recurrence plot

  • winsize (int) – size of the window we are using

Returns:

Dict (dict) – dictionary containing RQA variables from all sliding windows, keys are window number

Whole_window()#

Whole_window(RP, maxsize)[source]#

Function for computing the RQA variables from the whole RP

Parameters:
  • RP (ndarray) – recurrence plot(numpy 2D matrix)

  • maxsize (int) – size of the recurrence plot

Returns:

Dict (dict) – dictionary containing values of each of the RQA variables from the entire RP

windowed_RP()#

windowed_RP(winsize, RP_dir, save_path)[source]#

This function computes RQA variable from each window and stores that in a dictionary

Parameters:
  • RP_dir (str) – path to the directory where the RPs are stored as numpy files

  • winsize (int) – Size of window to be used

  • save_path (str) – path to the file in which the dictionary should be saved in the form of a pickle file

Returns:

Dict (dict) – dictionary containing values of each of the RQA variables from the entire RP

First_middle_last_avg()#

First_middle_last_avg(DICT, var, win_loc)[source]#

This is a function to compute different summary statistics from the RQA variable distribution that we would get from the windows

Parameters:
  • DICT_pre (str) – dictionary containing RQA variables from data(computed using the function WindowedRP)

  • var (str) – RQA variable name

  • win_loc (str) – Definition of the RQA estimate to be extracted

    first : RQA variables from the first window of the sliding windows

    middle : RQA variables from the middle window of the sliding windows

    last : RQA variables from the last window of the sliding windows

    max : maximum value of the RQA variables from the sliding windows

    avg : average value of the RQA variables from the sliding windows

    mode : mode of the RQA variables from the sliding windows

    median : median of the RQA variables from the sliding windows

    whole : RQA variable from the whole RP

Returns:

data (dataframe) – pandas dataframe containing the calculated summary statistic(specified) for the specified variable across different datasets

First_middle_last_sliding_windows()#

First_middle_last_sliding_windows(DICT, var, win_locs)[source]#

Function to compute all summary statistics that we want for a given RQA variable

Parameters:
  • DICT (str) – dictionary containing RQA variables from data(computed using the function WindowedRP)

  • var (str) – RQA variable name

  • win_locs (array) – Definitions of the RQA estimates to be extracted

Returns:

data (dataframe) – pandas dataframe containing the calculated set of summary statistic(specified) for the specified variable across different datasets

First_middle_last_sliding_windows_all_vars()#

First_middle_last_sliding_windows_all_vars(DICT, save_path, win_locs, vars)[source]#

Function to compute all summary statistics that we want across all RQA variables we want

Parameters:
  • DICT (dict) – dictionary containing RQA variables from data(computed using the function WindowedRP)

  • vars (array) – RQA variables to be extracted

  • win_locs (array) – Definitions of the RQA estimates to be extracted

  • save_path (str) – Path to the file where the data will be saved

Returns:

Saves the data, no output will be given by this function