RP_maker_diagnose#
Features#
fnnhitszero_Plot()#
- fnnhitszero_Plot(u, n, d, m, tau, sig, delta, Rmin, Rmax, rdiv)[source]#
Function that calculates the ratio of false nearest neighbours
- Parameters:
u (ndarray) – double array of shape (n,d). Think of it as n points in a d dimensional space
n (int) – number of samples or observations in the time series
d (int) – number of measurements or dimensions of the data
tau (int) – amount of delay
m (int) – number of embedding dimensions
r (double) – ratio parameter
sig (double) – standard deviation of the data
delta (double) – the tolerance value(the maximum difference from zero) for a value of FNN ratio to be effectively considered to be zero
Rmin (double) – minimum value of r from where we would start the parameter search
Rmax (double) – maximum value of r for defining the upper limit of parameter search
rdiv (Int) – number of divisions between Rmin and Rmax for parameter search
- Returns:
Rarr (array) – an array of r values
FNN (array) – corresponding false nearest neighbour values
References
Kennel, M. B., Brown, R., & Abarbanel, H. D. (1992). Determining embedding dimension for phase-space reconstruction using a geometrical construction. Physical review A, 45 (6), 3403.
findm_Plot()#
- findm_Plot(u, n, d, tau, sd, delta, Rmin, Rmax, rdiv, bound, save_path)[source]#
This is an effort to make plot given in Kantz, & Schreiber(2004) section 3.3.1
- Parameters:
u (ndarray) – double array of shape (n,d). Think of it as n points in a d dimensional space
n (int) – number of samples or observations in the time series
d (int) – number of measurements or dimensions of the data
tau (int) – amount of delay
r (double) – ratio parameter
sig (double) – standard deviation of the data
delta (double) – the tolerance value(the maximum difference from zero) for a value of FNN ratio to be effectively considered to be zero
Rmin (double) – minimum value of r from where we would start the parameter search
Rmax (double) – maximum value of r for defining the upper limit of parameter search
rdiv (Int) – number of divisions between Rmin and Rmax for parameter search
bound (double) – bound value for terminating the parameter serch for m
- Returns:
Saves a figure and a pickle file
References
Kennel, M. B., Brown, R., & Abarbanel, H. D. (1992). Determining embedding dimension for phase-space reconstruction using a geometrical construction. Physical review A, 45 (6), 3403.
Kantz, H., & Schreiber, T. (2004). Nonlinear time series analysis (Vol. 7). Cambridge university press. section 3.3.1
RP_diagnose()#
- RP_diagnose(input_path, diagnose_dir, rdiv=451, Rmin=1, Rmax=10, delta=0.001, bound=0.2)[source]#
Function to diagnose issues in finding the embedding dimension. It is similar to RP maker, but it deos not generate RP, nstead saves r vs FNN plot varying embedding dimensions and such plots are saved for each of the time series files present in the input directory
- Parameters:
input_path (str) – folder containing the numpy files, rows> number of samples, columns> number of streams
diagnose_dir (str) – folder where the plots needed for checks should be saved
rdiv (int) – number of divisions(resolution) for the variable r during parameter search for embedding dimension
Rmax (double) – maximum value for the variable r during parameter search for embedding dimension
Rmin (double) – minimum value for the variable r during parameter search for embedding dimension
delta (double) – the tolerance value below which an FNN value will be considered as zero
bound (double) – This is the value in the r value(at which FNN hits zero) va embedding dimension plot. The search is terminated if the value goes below this tolerance value and the value just below tolerance value is reported for embedding dimmension
- Returns:
Saves r vs FNN plot varying embedding dimensions and such plots are saved for each of the time series files present in the input directory to a path specified as diagnose directory
Error_Report_Sheet (file) – This is a csv file containing details of the files for which RP calculation was failed because of numpy.core._exceptions.MemoryError. This is due to an issue at the time delay estimation part, check dimensionality of the data
References
Kennel, M. B., Brown, R., & Abarbanel, H. D. (1992). Determining embedding dimension for phase-space reconstruction using a geometrical construction. Physical review A, 45 (6), 3403.
Kantz, H., & Schreiber, T. (2004). Nonlinear time series analysis (Vol. 7). Cambridge university press. section 3.3.1
get_minFNN_distribution_plot()#
- get_minFNN_distribution_plot(path, save_name)[source]#
This is a function used to get the delta value or the value used to effectively consider a particular value of FNN effectively as zero. This function estimates and plots the distribution of minimum FNN value for different embedding dimensions(m). It computes the upper(2.5% quantile) and lower(97.5% quantile) and when we want to get r(at FNN hitting zero) vs m graph, generally the delta value should be more than the highest upper bound(most likely for m=1) is choosen
- Parameters:
path (str) – path to folder containing pickes files computed using “RP_diagnose” function
savename (str) – The output plot and CSV file would be saved in the name specified
- Returns:
Saves a plot and a CSV file
References
Kennel, M. B., Brown, R., & Abarbanel, H. D. (1992). Determining embedding dimension for phase-space reconstruction using a geometrical construction. Physical review A, 45 (6), 3403.