ENH: stats: add array API-support #20544
Labels
array types
Items related to array API support and input array validation (see gh-18286)
enhancement
A new feature or improvement
scipy.stats
Towards gh-18867
This issue tracks progress toward the addition of array-API support to
scipy.stats
functions. The functions listed below look ready for conversion, and I'd be happy to review PRs for them. Priority, balancing the ease and importance of the task, is roughly in the order listed.moment
(ENH: stats.moment: add array API support #20292)skew
(ENH: stats.skew: add array-API support #20541 - please see this PR as an example roughly similarkurtosis
throughdirectional_stats
)kurtosis
(ENH: stats.kurtosis: add array API support #20658)describe
(ENH: stats.describe: add array API support #20667)mode
entropy
(ENH: stats.entropy / special.entr / special.rel_entr: add array API support #20673)variation
(ENH: stats.variation: add array-API support #20647)sem
(ENH: stats.sem: add array-API support #20631)kstat
(ENH: stats: add array-API support to kstat/kstatvar #20634)kstatvar
(ENH: stats: add array-API support to kstat/kstatvar #20634circmean
(ENH: stats.circ___: add array-API support #20595)circvar
(ENH: stats.circ___: add array-API support #20595)circstd
(ENH: stats.circ___: add array-API support #20595)directional_stats
pearsonr
(ENH: stats.pearsonr: add array API support #20284)linregress
-cov
doesn'tttest_1samp
(ENH: stats.ttest_1samp: add array-API support #20545 - please see this PR as an example forttest_rel
throughnormaltest
)ttest_rel
ttest_ind
skewtest
(ENH: stats.skewtest: add array-API support #20597)kurtosistest
jarque_bera
normaltest
power_divergence
(for simplicity, split off old version, which supports masked arrays)chisquare
After that:
mean
and make it behave like all the rest of our stats functions - avoiding excess noise, includingnan_policy
, etc. If that is accepted, might as well addvar
, too.gmean
hmean
pmean
After that:
_array_api.cov
; consider making it public if array API won't offer itlinregress
: addaxis
and array API supportks_2samp
: consider natively vectorizing, then adding array API supportbartlett
: consider natively vectorizing, then adding array API supportlevene
: consider natively vectorizing, then adding array API supportanserson_ksamp
: might be able to vectorize, then add array API supportwasserstein_distance
: consider natively vectorizing, then adding array API supportenergy_distance
: consider natively vectorizing, then adding array API supportI'd like to implement the following using
_masked_array
(gh-20363):tmean
tvar
tmin
tmax
tstd
tsem
These functions are held up by
rankdata
(possibly among other things), which is itself in need of improved array-API support. See gh-20639.kendalltau
mannwhitneyu
wilcoxon
kruskal
cramervonmises_2samp
friedmanchisquare
brunnermunzel
ansari
fligner
mood
These functions need
median
,quantile
, or similar, either directly or viaiqr
. See data-apis/array-api#795.iqr
siegelslopes
theilslopes
median_test
median_abs_deviation
epps_singleton_2samp
levene
(optional)fligner
(optional)sen_seasonal_slopes
I am not interested in supporting the following functions:
bayes_mvs
,mvsdist
, the frequency statistics,weightedtau
,somersd
or other tabular methods,multiscale_graphcorr
.Many other functions are not listed here because they really need special function support to be useful.
I wrote the following functions, so I'd prefer to do the upgrades on those personally.
monte_carlo_test
(ENH: stats.monte_carlo_test: add array API support #20604)permutation_test
bootstrap
goodness_of_fit
power
false_discovery_control
differential_entropy
The text was updated successfully, but these errors were encountered: