pyhctsa.operations.correlation.stick_angles¶
- pyhctsa.operations.correlation.stick_angles(y)¶
Analysis of the angles between successive same-sign time-series values.
Treats each time-series value as a stick protruding from a baseline at zero. Sticks above the baseline form a positive set and those below it a negative set. Within each set, the angle between successive sticks is the arctangent of the slope from one stick’s tip to the next: the difference in height divided by the number of samples between them. Statistics are returned on the positive angles (
_p), the negative angles (_n) and all of them (_all, and the outputs with no suffix). Thetau,ac1, quantile andstatavoutputs use the angle sequences standardized to zero mean and unit variance. The set of all angles is the positive set’s sequence followed by the negative set’s: its distributional statistics (std,mean,median, quantiles, skewness, kurtosis) do not depend on that order, but itsstatavoutputs do, and compare the positive with the negative set (and, for more than two parts, parts within each set) rather than segments in time.- Parameters:¶
- y : array-like¶
The input time series (assumed z-scored, so that the sign split is about the mean).
- Returns:¶
mean_p,median_p,mean_n,median_n,mean,median,std: the mean, median and standard deviation of the angles (positive set, negative set, or all angles)statav{2,3,4,5}_{p,n}_{m,s},statav{2,3,4,5}_all_m,statav5_all_s: the standard deviation across 2, 3, 4 or 5 equal parts of the sequence of the mean (_m) or the standard deviation (_s) of the angles, divided by their overall standard deviation (for_all, parts of the positive-then-negative sequence)tau_p,tau_n: the first zero-crossing of the autocorrelation function of the positive or negative set’s angle sequence (interpolated);ac1_p,ac1_n: their lag-1 autocorrelationsq1_*,q10_*,q90_*,q99_*(_p,_n,_all): quantiles of the standardized angles;skewness_*,kurtosis_*: skewness and kurtosis of the anglesratmean_p,ratmean_n: the mean of the positive angles divided by the mean of the negative angles within the positive or negative set
pnsumabsdiffis the summed absolute difference between the histograms (the proportion of angles in each of 20 bins spanning -pi/2 to pi/2) of the positive and negative angles (0 if identical, 2 if they share no bin);symks_pandsymks_nare half the summed absolute difference between the histogram of the positive or negative set’s angles and its mirror image about zero (0 if symmetric, 1 if all angles are in bins whose mirror image is empty).As in hctsa, redundant statistics are not returned:
std_p,std_n,statav2_all_s,statav3_all_s,statav4_all_s,ac2_p,ac2_n,ac2_all,tau_allandac1_all.- Return type:¶
dict