Skip to content

Commit

Permalink
Add more tests for JESS_filters_generic; fix spelling in JESS_filters…
Browse files Browse the repository at this point in the history
…_generic; fix numpy warning in scipy_cupy/stats.
  • Loading branch information
josephwkania committed Mar 18, 2024
1 parent 458e74e commit 13d06ef
Show file tree
Hide file tree
Showing 3 changed files with 420 additions and 9 deletions.
16 changes: 8 additions & 8 deletions jess/JESS_filters_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def _calculate_kurtosis_z(kurtosis: xp.ndarray, spb: int) -> xp.ndarray:
kurtosis z score
"""
# calculate_skew_and_kurtosis returns fisher=True
# so we want the differnce
# so we want the difference
fisher_corr = 3.0 * ((spb - 1) / (spb + 1) - 1)
varb2 = (
24.0
Expand Down Expand Up @@ -197,10 +197,10 @@ def dagostino(
taking into account the number of samples in each block
We calculate the D'Agostino along the time axis in blocks of `samples_per_block`.
This is balanced if the number of samples is not evenly divisible.
The D'Agostino K^2 statstic is tailed.
The D'Agostino K^2 statistic is tailed.
This makes our Gaussian outlier flagging remove more data than expected.
To combate this we take the squareroot of the K^2 Statistic, this makes the
distrabution more Gaussian and the flagging work better.
To combat this we take the square-root of the K^2 Statistic, this makes the
distribution more Gaussian and the flagging work better.
Args:
dynamic_spectra - Section spectra time on the vertical axis
Expand Down Expand Up @@ -275,10 +275,10 @@ def jarque_bera(
Jarque-Bera Gaussianity test, this uses a combination of Kurtosis and Skew.
We calculate Jarque-Bera along the time axis in blocks of `samples_per_block`.
This is balanced if the number of samples is not evenly divisible.
The Jarque-Bera statstic is Chi-Squared distributed with two degrees of freedom.
The Jarque-Bera statistic is Chi-Squared distributed with two degrees of freedom.
This makes our Gaussian outlier flagging remove more data than expected.
To combate this we take the squareroot of the Jarque Statistic, this makes the
distrabution more Gaussian and the flagging work better.
To combat this we take the square-root of the Jarque-Bera Statistic, this makes the
distribution more Gaussian and the flagging work better.
Args:
Expand Down Expand Up @@ -411,7 +411,7 @@ def mad_spectra_flat(
It then calculates the Median Absolute Deviation for every frame channels.
Outliers are removed based on the assumption of Gaussian data. The dynamic
spectra is then detrended again, masking the outliers. This process is then
repeated again. The data is returned centerned around flatten_to with removed
repeated again. The data is returned centered around flatten_to with removed
points set as flatten_to.
Args:
Expand Down
2 changes: 1 addition & 1 deletion jess/scipy_cupy/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ def iqr_med(

rng = sorted(rng)
pct = percentile_func(
x, rng + [50], axis=axis, interpolation=interpolation, keepdims=keepdims
x, rng + [50], axis=axis, method=interpolation, keepdims=keepdims
)
out = xp.subtract(pct[1], pct[0])

Expand Down
Loading

0 comments on commit 13d06ef

Please sign in to comment.