scipy 1.16.2__cp314-cp314-win_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scipy/__config__.py +161 -0
- scipy/__init__.py +150 -0
- scipy/_cyutility.cp314-win_arm64.lib +0 -0
- scipy/_cyutility.cp314-win_arm64.pyd +0 -0
- scipy/_distributor_init.py +18 -0
- scipy/_lib/__init__.py +14 -0
- scipy/_lib/_array_api.py +931 -0
- scipy/_lib/_array_api_compat_vendor.py +9 -0
- scipy/_lib/_array_api_no_0d.py +103 -0
- scipy/_lib/_bunch.py +229 -0
- scipy/_lib/_ccallback.py +251 -0
- scipy/_lib/_ccallback_c.cp314-win_arm64.lib +0 -0
- scipy/_lib/_ccallback_c.cp314-win_arm64.pyd +0 -0
- scipy/_lib/_disjoint_set.py +254 -0
- scipy/_lib/_docscrape.py +761 -0
- scipy/_lib/_elementwise_iterative_method.py +346 -0
- scipy/_lib/_fpumode.cp314-win_arm64.lib +0 -0
- scipy/_lib/_fpumode.cp314-win_arm64.pyd +0 -0
- scipy/_lib/_gcutils.py +105 -0
- scipy/_lib/_pep440.py +487 -0
- scipy/_lib/_sparse.py +41 -0
- scipy/_lib/_test_ccallback.cp314-win_arm64.lib +0 -0
- scipy/_lib/_test_ccallback.cp314-win_arm64.pyd +0 -0
- scipy/_lib/_test_deprecation_call.cp314-win_arm64.lib +0 -0
- scipy/_lib/_test_deprecation_call.cp314-win_arm64.pyd +0 -0
- scipy/_lib/_test_deprecation_def.cp314-win_arm64.lib +0 -0
- scipy/_lib/_test_deprecation_def.cp314-win_arm64.pyd +0 -0
- scipy/_lib/_testutils.py +373 -0
- scipy/_lib/_threadsafety.py +58 -0
- scipy/_lib/_tmpdirs.py +86 -0
- scipy/_lib/_uarray/LICENSE +29 -0
- scipy/_lib/_uarray/__init__.py +116 -0
- scipy/_lib/_uarray/_backend.py +707 -0
- scipy/_lib/_uarray/_uarray.cp314-win_arm64.lib +0 -0
- scipy/_lib/_uarray/_uarray.cp314-win_arm64.pyd +0 -0
- scipy/_lib/_util.py +1283 -0
- scipy/_lib/array_api_compat/__init__.py +22 -0
- scipy/_lib/array_api_compat/_internal.py +59 -0
- scipy/_lib/array_api_compat/common/__init__.py +1 -0
- scipy/_lib/array_api_compat/common/_aliases.py +727 -0
- scipy/_lib/array_api_compat/common/_fft.py +213 -0
- scipy/_lib/array_api_compat/common/_helpers.py +1058 -0
- scipy/_lib/array_api_compat/common/_linalg.py +232 -0
- scipy/_lib/array_api_compat/common/_typing.py +192 -0
- scipy/_lib/array_api_compat/cupy/__init__.py +13 -0
- scipy/_lib/array_api_compat/cupy/_aliases.py +156 -0
- scipy/_lib/array_api_compat/cupy/_info.py +336 -0
- scipy/_lib/array_api_compat/cupy/_typing.py +31 -0
- scipy/_lib/array_api_compat/cupy/fft.py +36 -0
- scipy/_lib/array_api_compat/cupy/linalg.py +49 -0
- scipy/_lib/array_api_compat/dask/__init__.py +0 -0
- scipy/_lib/array_api_compat/dask/array/__init__.py +12 -0
- scipy/_lib/array_api_compat/dask/array/_aliases.py +376 -0
- scipy/_lib/array_api_compat/dask/array/_info.py +416 -0
- scipy/_lib/array_api_compat/dask/array/fft.py +21 -0
- scipy/_lib/array_api_compat/dask/array/linalg.py +72 -0
- scipy/_lib/array_api_compat/numpy/__init__.py +28 -0
- scipy/_lib/array_api_compat/numpy/_aliases.py +190 -0
- scipy/_lib/array_api_compat/numpy/_info.py +366 -0
- scipy/_lib/array_api_compat/numpy/_typing.py +30 -0
- scipy/_lib/array_api_compat/numpy/fft.py +35 -0
- scipy/_lib/array_api_compat/numpy/linalg.py +143 -0
- scipy/_lib/array_api_compat/torch/__init__.py +22 -0
- scipy/_lib/array_api_compat/torch/_aliases.py +855 -0
- scipy/_lib/array_api_compat/torch/_info.py +369 -0
- scipy/_lib/array_api_compat/torch/_typing.py +3 -0
- scipy/_lib/array_api_compat/torch/fft.py +85 -0
- scipy/_lib/array_api_compat/torch/linalg.py +121 -0
- scipy/_lib/array_api_extra/__init__.py +38 -0
- scipy/_lib/array_api_extra/_delegation.py +171 -0
- scipy/_lib/array_api_extra/_lib/__init__.py +1 -0
- scipy/_lib/array_api_extra/_lib/_at.py +463 -0
- scipy/_lib/array_api_extra/_lib/_backends.py +46 -0
- scipy/_lib/array_api_extra/_lib/_funcs.py +937 -0
- scipy/_lib/array_api_extra/_lib/_lazy.py +357 -0
- scipy/_lib/array_api_extra/_lib/_testing.py +278 -0
- scipy/_lib/array_api_extra/_lib/_utils/__init__.py +1 -0
- scipy/_lib/array_api_extra/_lib/_utils/_compat.py +74 -0
- scipy/_lib/array_api_extra/_lib/_utils/_compat.pyi +45 -0
- scipy/_lib/array_api_extra/_lib/_utils/_helpers.py +559 -0
- scipy/_lib/array_api_extra/_lib/_utils/_typing.py +10 -0
- scipy/_lib/array_api_extra/_lib/_utils/_typing.pyi +105 -0
- scipy/_lib/array_api_extra/testing.py +359 -0
- scipy/_lib/cobyqa/__init__.py +20 -0
- scipy/_lib/cobyqa/framework.py +1240 -0
- scipy/_lib/cobyqa/main.py +1506 -0
- scipy/_lib/cobyqa/models.py +1529 -0
- scipy/_lib/cobyqa/problem.py +1296 -0
- scipy/_lib/cobyqa/settings.py +132 -0
- scipy/_lib/cobyqa/subsolvers/__init__.py +14 -0
- scipy/_lib/cobyqa/subsolvers/geometry.py +387 -0
- scipy/_lib/cobyqa/subsolvers/optim.py +1203 -0
- scipy/_lib/cobyqa/utils/__init__.py +18 -0
- scipy/_lib/cobyqa/utils/exceptions.py +22 -0
- scipy/_lib/cobyqa/utils/math.py +77 -0
- scipy/_lib/cobyqa/utils/versions.py +67 -0
- scipy/_lib/decorator.py +399 -0
- scipy/_lib/deprecation.py +274 -0
- scipy/_lib/doccer.py +366 -0
- scipy/_lib/messagestream.cp314-win_arm64.lib +0 -0
- scipy/_lib/messagestream.cp314-win_arm64.pyd +0 -0
- scipy/_lib/pyprima/__init__.py +212 -0
- scipy/_lib/pyprima/cobyla/__init__.py +0 -0
- scipy/_lib/pyprima/cobyla/cobyla.py +559 -0
- scipy/_lib/pyprima/cobyla/cobylb.py +714 -0
- scipy/_lib/pyprima/cobyla/geometry.py +226 -0
- scipy/_lib/pyprima/cobyla/initialize.py +215 -0
- scipy/_lib/pyprima/cobyla/trustregion.py +492 -0
- scipy/_lib/pyprima/cobyla/update.py +289 -0
- scipy/_lib/pyprima/common/__init__.py +0 -0
- scipy/_lib/pyprima/common/_bounds.py +34 -0
- scipy/_lib/pyprima/common/_linear_constraints.py +46 -0
- scipy/_lib/pyprima/common/_nonlinear_constraints.py +54 -0
- scipy/_lib/pyprima/common/_project.py +173 -0
- scipy/_lib/pyprima/common/checkbreak.py +93 -0
- scipy/_lib/pyprima/common/consts.py +47 -0
- scipy/_lib/pyprima/common/evaluate.py +99 -0
- scipy/_lib/pyprima/common/history.py +38 -0
- scipy/_lib/pyprima/common/infos.py +30 -0
- scipy/_lib/pyprima/common/linalg.py +435 -0
- scipy/_lib/pyprima/common/message.py +290 -0
- scipy/_lib/pyprima/common/powalg.py +131 -0
- scipy/_lib/pyprima/common/preproc.py +277 -0
- scipy/_lib/pyprima/common/present.py +5 -0
- scipy/_lib/pyprima/common/ratio.py +54 -0
- scipy/_lib/pyprima/common/redrho.py +47 -0
- scipy/_lib/pyprima/common/selectx.py +296 -0
- scipy/_lib/tests/__init__.py +0 -0
- scipy/_lib/tests/test__gcutils.py +110 -0
- scipy/_lib/tests/test__pep440.py +67 -0
- scipy/_lib/tests/test__testutils.py +32 -0
- scipy/_lib/tests/test__threadsafety.py +51 -0
- scipy/_lib/tests/test__util.py +641 -0
- scipy/_lib/tests/test_array_api.py +322 -0
- scipy/_lib/tests/test_bunch.py +169 -0
- scipy/_lib/tests/test_ccallback.py +196 -0
- scipy/_lib/tests/test_config.py +45 -0
- scipy/_lib/tests/test_deprecation.py +10 -0
- scipy/_lib/tests/test_doccer.py +143 -0
- scipy/_lib/tests/test_import_cycles.py +18 -0
- scipy/_lib/tests/test_public_api.py +482 -0
- scipy/_lib/tests/test_scipy_version.py +28 -0
- scipy/_lib/tests/test_tmpdirs.py +48 -0
- scipy/_lib/tests/test_warnings.py +137 -0
- scipy/_lib/uarray.py +31 -0
- scipy/cluster/__init__.py +31 -0
- scipy/cluster/_hierarchy.cp314-win_arm64.lib +0 -0
- scipy/cluster/_hierarchy.cp314-win_arm64.pyd +0 -0
- scipy/cluster/_optimal_leaf_ordering.cp314-win_arm64.lib +0 -0
- scipy/cluster/_optimal_leaf_ordering.cp314-win_arm64.pyd +0 -0
- scipy/cluster/_vq.cp314-win_arm64.lib +0 -0
- scipy/cluster/_vq.cp314-win_arm64.pyd +0 -0
- scipy/cluster/hierarchy.py +4348 -0
- scipy/cluster/tests/__init__.py +0 -0
- scipy/cluster/tests/hierarchy_test_data.py +145 -0
- scipy/cluster/tests/test_disjoint_set.py +202 -0
- scipy/cluster/tests/test_hierarchy.py +1238 -0
- scipy/cluster/tests/test_vq.py +434 -0
- scipy/cluster/vq.py +832 -0
- scipy/conftest.py +683 -0
- scipy/constants/__init__.py +358 -0
- scipy/constants/_codata.py +2266 -0
- scipy/constants/_constants.py +369 -0
- scipy/constants/codata.py +21 -0
- scipy/constants/constants.py +53 -0
- scipy/constants/tests/__init__.py +0 -0
- scipy/constants/tests/test_codata.py +78 -0
- scipy/constants/tests/test_constants.py +83 -0
- scipy/datasets/__init__.py +90 -0
- scipy/datasets/_download_all.py +71 -0
- scipy/datasets/_fetchers.py +225 -0
- scipy/datasets/_registry.py +26 -0
- scipy/datasets/_utils.py +81 -0
- scipy/datasets/tests/__init__.py +0 -0
- scipy/datasets/tests/test_data.py +128 -0
- scipy/differentiate/__init__.py +27 -0
- scipy/differentiate/_differentiate.py +1129 -0
- scipy/differentiate/tests/__init__.py +0 -0
- scipy/differentiate/tests/test_differentiate.py +694 -0
- scipy/fft/__init__.py +114 -0
- scipy/fft/_backend.py +196 -0
- scipy/fft/_basic.py +1650 -0
- scipy/fft/_basic_backend.py +197 -0
- scipy/fft/_debug_backends.py +22 -0
- scipy/fft/_fftlog.py +223 -0
- scipy/fft/_fftlog_backend.py +200 -0
- scipy/fft/_helper.py +348 -0
- scipy/fft/_pocketfft/LICENSE.md +25 -0
- scipy/fft/_pocketfft/__init__.py +9 -0
- scipy/fft/_pocketfft/basic.py +251 -0
- scipy/fft/_pocketfft/helper.py +249 -0
- scipy/fft/_pocketfft/pypocketfft.cp314-win_arm64.lib +0 -0
- scipy/fft/_pocketfft/pypocketfft.cp314-win_arm64.pyd +0 -0
- scipy/fft/_pocketfft/realtransforms.py +109 -0
- scipy/fft/_pocketfft/tests/__init__.py +0 -0
- scipy/fft/_pocketfft/tests/test_basic.py +1011 -0
- scipy/fft/_pocketfft/tests/test_real_transforms.py +505 -0
- scipy/fft/_realtransforms.py +706 -0
- scipy/fft/_realtransforms_backend.py +63 -0
- scipy/fft/tests/__init__.py +0 -0
- scipy/fft/tests/mock_backend.py +96 -0
- scipy/fft/tests/test_backend.py +98 -0
- scipy/fft/tests/test_basic.py +504 -0
- scipy/fft/tests/test_fftlog.py +215 -0
- scipy/fft/tests/test_helper.py +558 -0
- scipy/fft/tests/test_multithreading.py +84 -0
- scipy/fft/tests/test_real_transforms.py +247 -0
- scipy/fftpack/__init__.py +103 -0
- scipy/fftpack/_basic.py +428 -0
- scipy/fftpack/_helper.py +115 -0
- scipy/fftpack/_pseudo_diffs.py +554 -0
- scipy/fftpack/_realtransforms.py +598 -0
- scipy/fftpack/basic.py +20 -0
- scipy/fftpack/convolve.cp314-win_arm64.lib +0 -0
- scipy/fftpack/convolve.cp314-win_arm64.pyd +0 -0
- scipy/fftpack/helper.py +19 -0
- scipy/fftpack/pseudo_diffs.py +22 -0
- scipy/fftpack/realtransforms.py +19 -0
- scipy/fftpack/tests/__init__.py +0 -0
- scipy/fftpack/tests/fftw_double_ref.npz +0 -0
- scipy/fftpack/tests/fftw_longdouble_ref.npz +0 -0
- scipy/fftpack/tests/fftw_single_ref.npz +0 -0
- scipy/fftpack/tests/test.npz +0 -0
- scipy/fftpack/tests/test_basic.py +877 -0
- scipy/fftpack/tests/test_helper.py +54 -0
- scipy/fftpack/tests/test_import.py +33 -0
- scipy/fftpack/tests/test_pseudo_diffs.py +388 -0
- scipy/fftpack/tests/test_real_transforms.py +836 -0
- scipy/integrate/__init__.py +122 -0
- scipy/integrate/_bvp.py +1160 -0
- scipy/integrate/_cubature.py +729 -0
- scipy/integrate/_dop.cp314-win_arm64.lib +0 -0
- scipy/integrate/_dop.cp314-win_arm64.pyd +0 -0
- scipy/integrate/_ivp/__init__.py +8 -0
- scipy/integrate/_ivp/base.py +290 -0
- scipy/integrate/_ivp/bdf.py +478 -0
- scipy/integrate/_ivp/common.py +451 -0
- scipy/integrate/_ivp/dop853_coefficients.py +193 -0
- scipy/integrate/_ivp/ivp.py +755 -0
- scipy/integrate/_ivp/lsoda.py +224 -0
- scipy/integrate/_ivp/radau.py +572 -0
- scipy/integrate/_ivp/rk.py +601 -0
- scipy/integrate/_ivp/tests/__init__.py +0 -0
- scipy/integrate/_ivp/tests/test_ivp.py +1287 -0
- scipy/integrate/_ivp/tests/test_rk.py +37 -0
- scipy/integrate/_lebedev.py +5450 -0
- scipy/integrate/_lsoda.cp314-win_arm64.lib +0 -0
- scipy/integrate/_lsoda.cp314-win_arm64.pyd +0 -0
- scipy/integrate/_ode.py +1395 -0
- scipy/integrate/_odepack.cp314-win_arm64.lib +0 -0
- scipy/integrate/_odepack.cp314-win_arm64.pyd +0 -0
- scipy/integrate/_odepack_py.py +273 -0
- scipy/integrate/_quad_vec.py +674 -0
- scipy/integrate/_quadpack.cp314-win_arm64.lib +0 -0
- scipy/integrate/_quadpack.cp314-win_arm64.pyd +0 -0
- scipy/integrate/_quadpack_py.py +1283 -0
- scipy/integrate/_quadrature.py +1336 -0
- scipy/integrate/_rules/__init__.py +12 -0
- scipy/integrate/_rules/_base.py +518 -0
- scipy/integrate/_rules/_gauss_kronrod.py +202 -0
- scipy/integrate/_rules/_gauss_legendre.py +62 -0
- scipy/integrate/_rules/_genz_malik.py +210 -0
- scipy/integrate/_tanhsinh.py +1385 -0
- scipy/integrate/_test_multivariate.cp314-win_arm64.lib +0 -0
- scipy/integrate/_test_multivariate.cp314-win_arm64.pyd +0 -0
- scipy/integrate/_test_odeint_banded.cp314-win_arm64.lib +0 -0
- scipy/integrate/_test_odeint_banded.cp314-win_arm64.pyd +0 -0
- scipy/integrate/_vode.cp314-win_arm64.lib +0 -0
- scipy/integrate/_vode.cp314-win_arm64.pyd +0 -0
- scipy/integrate/dop.py +15 -0
- scipy/integrate/lsoda.py +15 -0
- scipy/integrate/odepack.py +17 -0
- scipy/integrate/quadpack.py +23 -0
- scipy/integrate/tests/__init__.py +0 -0
- scipy/integrate/tests/test__quad_vec.py +211 -0
- scipy/integrate/tests/test_banded_ode_solvers.py +305 -0
- scipy/integrate/tests/test_bvp.py +714 -0
- scipy/integrate/tests/test_cubature.py +1375 -0
- scipy/integrate/tests/test_integrate.py +840 -0
- scipy/integrate/tests/test_odeint_jac.py +74 -0
- scipy/integrate/tests/test_quadpack.py +680 -0
- scipy/integrate/tests/test_quadrature.py +730 -0
- scipy/integrate/tests/test_tanhsinh.py +1171 -0
- scipy/integrate/vode.py +15 -0
- scipy/interpolate/__init__.py +228 -0
- scipy/interpolate/_bary_rational.py +715 -0
- scipy/interpolate/_bsplines.py +2469 -0
- scipy/interpolate/_cubic.py +973 -0
- scipy/interpolate/_dfitpack.cp314-win_arm64.lib +0 -0
- scipy/interpolate/_dfitpack.cp314-win_arm64.pyd +0 -0
- scipy/interpolate/_dierckx.cp314-win_arm64.lib +0 -0
- scipy/interpolate/_dierckx.cp314-win_arm64.pyd +0 -0
- scipy/interpolate/_fitpack.cp314-win_arm64.lib +0 -0
- scipy/interpolate/_fitpack.cp314-win_arm64.pyd +0 -0
- scipy/interpolate/_fitpack2.py +2397 -0
- scipy/interpolate/_fitpack_impl.py +811 -0
- scipy/interpolate/_fitpack_py.py +898 -0
- scipy/interpolate/_fitpack_repro.py +996 -0
- scipy/interpolate/_interpnd.cp314-win_arm64.lib +0 -0
- scipy/interpolate/_interpnd.cp314-win_arm64.pyd +0 -0
- scipy/interpolate/_interpolate.py +2266 -0
- scipy/interpolate/_ndbspline.py +415 -0
- scipy/interpolate/_ndgriddata.py +329 -0
- scipy/interpolate/_pade.py +67 -0
- scipy/interpolate/_polyint.py +1025 -0
- scipy/interpolate/_ppoly.cp314-win_arm64.lib +0 -0
- scipy/interpolate/_ppoly.cp314-win_arm64.pyd +0 -0
- scipy/interpolate/_rbf.py +290 -0
- scipy/interpolate/_rbfinterp.py +550 -0
- scipy/interpolate/_rbfinterp_pythran.cp314-win_arm64.lib +0 -0
- scipy/interpolate/_rbfinterp_pythran.cp314-win_arm64.pyd +0 -0
- scipy/interpolate/_rgi.py +764 -0
- scipy/interpolate/_rgi_cython.cp314-win_arm64.lib +0 -0
- scipy/interpolate/_rgi_cython.cp314-win_arm64.pyd +0 -0
- scipy/interpolate/dfitpack.py +24 -0
- scipy/interpolate/fitpack.py +31 -0
- scipy/interpolate/fitpack2.py +29 -0
- scipy/interpolate/interpnd.py +24 -0
- scipy/interpolate/interpolate.py +30 -0
- scipy/interpolate/ndgriddata.py +23 -0
- scipy/interpolate/polyint.py +24 -0
- scipy/interpolate/rbf.py +18 -0
- scipy/interpolate/tests/__init__.py +0 -0
- scipy/interpolate/tests/data/bug-1310.npz +0 -0
- scipy/interpolate/tests/data/estimate_gradients_hang.npy +0 -0
- scipy/interpolate/tests/data/gcvspl.npz +0 -0
- scipy/interpolate/tests/test_bary_rational.py +368 -0
- scipy/interpolate/tests/test_bsplines.py +3754 -0
- scipy/interpolate/tests/test_fitpack.py +519 -0
- scipy/interpolate/tests/test_fitpack2.py +1431 -0
- scipy/interpolate/tests/test_gil.py +64 -0
- scipy/interpolate/tests/test_interpnd.py +452 -0
- scipy/interpolate/tests/test_interpolate.py +2630 -0
- scipy/interpolate/tests/test_ndgriddata.py +308 -0
- scipy/interpolate/tests/test_pade.py +107 -0
- scipy/interpolate/tests/test_polyint.py +972 -0
- scipy/interpolate/tests/test_rbf.py +246 -0
- scipy/interpolate/tests/test_rbfinterp.py +534 -0
- scipy/interpolate/tests/test_rgi.py +1151 -0
- scipy/io/__init__.py +116 -0
- scipy/io/_fast_matrix_market/__init__.py +600 -0
- scipy/io/_fast_matrix_market/_fmm_core.cp314-win_arm64.lib +0 -0
- scipy/io/_fast_matrix_market/_fmm_core.cp314-win_arm64.pyd +0 -0
- scipy/io/_fortran.py +354 -0
- scipy/io/_harwell_boeing/__init__.py +7 -0
- scipy/io/_harwell_boeing/_fortran_format_parser.py +316 -0
- scipy/io/_harwell_boeing/hb.py +571 -0
- scipy/io/_harwell_boeing/tests/__init__.py +0 -0
- scipy/io/_harwell_boeing/tests/test_fortran_format.py +74 -0
- scipy/io/_harwell_boeing/tests/test_hb.py +70 -0
- scipy/io/_idl.py +917 -0
- scipy/io/_mmio.py +968 -0
- scipy/io/_netcdf.py +1104 -0
- scipy/io/_test_fortran.cp314-win_arm64.lib +0 -0
- scipy/io/_test_fortran.cp314-win_arm64.pyd +0 -0
- scipy/io/arff/__init__.py +28 -0
- scipy/io/arff/_arffread.py +873 -0
- scipy/io/arff/arffread.py +19 -0
- scipy/io/arff/tests/__init__.py +0 -0
- scipy/io/arff/tests/data/iris.arff +225 -0
- scipy/io/arff/tests/data/missing.arff +8 -0
- scipy/io/arff/tests/data/nodata.arff +11 -0
- scipy/io/arff/tests/data/quoted_nominal.arff +13 -0
- scipy/io/arff/tests/data/quoted_nominal_spaces.arff +13 -0
- scipy/io/arff/tests/data/test1.arff +10 -0
- scipy/io/arff/tests/data/test10.arff +8 -0
- scipy/io/arff/tests/data/test11.arff +11 -0
- scipy/io/arff/tests/data/test2.arff +15 -0
- scipy/io/arff/tests/data/test3.arff +6 -0
- scipy/io/arff/tests/data/test4.arff +11 -0
- scipy/io/arff/tests/data/test5.arff +26 -0
- scipy/io/arff/tests/data/test6.arff +12 -0
- scipy/io/arff/tests/data/test7.arff +15 -0
- scipy/io/arff/tests/data/test8.arff +12 -0
- scipy/io/arff/tests/data/test9.arff +14 -0
- scipy/io/arff/tests/test_arffread.py +421 -0
- scipy/io/harwell_boeing.py +17 -0
- scipy/io/idl.py +17 -0
- scipy/io/matlab/__init__.py +66 -0
- scipy/io/matlab/_byteordercodes.py +75 -0
- scipy/io/matlab/_mio.py +375 -0
- scipy/io/matlab/_mio4.py +632 -0
- scipy/io/matlab/_mio5.py +901 -0
- scipy/io/matlab/_mio5_params.py +281 -0
- scipy/io/matlab/_mio5_utils.cp314-win_arm64.lib +0 -0
- scipy/io/matlab/_mio5_utils.cp314-win_arm64.pyd +0 -0
- scipy/io/matlab/_mio_utils.cp314-win_arm64.lib +0 -0
- scipy/io/matlab/_mio_utils.cp314-win_arm64.pyd +0 -0
- scipy/io/matlab/_miobase.py +435 -0
- scipy/io/matlab/_streams.cp314-win_arm64.lib +0 -0
- scipy/io/matlab/_streams.cp314-win_arm64.pyd +0 -0
- scipy/io/matlab/byteordercodes.py +17 -0
- scipy/io/matlab/mio.py +16 -0
- scipy/io/matlab/mio4.py +17 -0
- scipy/io/matlab/mio5.py +19 -0
- scipy/io/matlab/mio5_params.py +18 -0
- scipy/io/matlab/mio5_utils.py +17 -0
- scipy/io/matlab/mio_utils.py +17 -0
- scipy/io/matlab/miobase.py +16 -0
- scipy/io/matlab/streams.py +16 -0
- scipy/io/matlab/tests/__init__.py +0 -0
- scipy/io/matlab/tests/data/bad_miuint32.mat +0 -0
- scipy/io/matlab/tests/data/bad_miutf8_array_name.mat +0 -0
- scipy/io/matlab/tests/data/big_endian.mat +0 -0
- scipy/io/matlab/tests/data/broken_utf8.mat +0 -0
- scipy/io/matlab/tests/data/corrupted_zlib_checksum.mat +0 -0
- scipy/io/matlab/tests/data/corrupted_zlib_data.mat +0 -0
- scipy/io/matlab/tests/data/debigged_m4.mat +0 -0
- scipy/io/matlab/tests/data/japanese_utf8.txt +5 -0
- scipy/io/matlab/tests/data/little_endian.mat +0 -0
- scipy/io/matlab/tests/data/logical_sparse.mat +0 -0
- scipy/io/matlab/tests/data/malformed1.mat +0 -0
- scipy/io/matlab/tests/data/miuint32_for_miint32.mat +0 -0
- scipy/io/matlab/tests/data/miutf8_array_name.mat +0 -0
- scipy/io/matlab/tests/data/nasty_duplicate_fieldnames.mat +0 -0
- scipy/io/matlab/tests/data/one_by_zero_char.mat +0 -0
- scipy/io/matlab/tests/data/parabola.mat +0 -0
- scipy/io/matlab/tests/data/single_empty_string.mat +0 -0
- scipy/io/matlab/tests/data/some_functions.mat +0 -0
- scipy/io/matlab/tests/data/sqr.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/test_empty_struct.mat +0 -0
- scipy/io/matlab/tests/data/test_mat4_le_floats.mat +0 -0
- scipy/io/matlab/tests/data/test_skip_variable.mat +0 -0
- scipy/io/matlab/tests/data/testbool_8_WIN64.mat +0 -0
- scipy/io/matlab/tests/data/testcell_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcell_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcell_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcell_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_5.3_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testfunc_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testhdf5_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testminus_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testminus_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testminus_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testminus_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testminus_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmulti_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testmulti_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmulti_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testobject_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testobject_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testobject_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testobject_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testscalarcell_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsimplecell.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsefloat_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststring_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststring_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststring_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststring_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststring_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testunicode_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testunicode_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testvec_4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/test_byteordercodes.py +29 -0
- scipy/io/matlab/tests/test_mio.py +1399 -0
- scipy/io/matlab/tests/test_mio5_utils.py +179 -0
- scipy/io/matlab/tests/test_mio_funcs.py +51 -0
- scipy/io/matlab/tests/test_mio_utils.py +45 -0
- scipy/io/matlab/tests/test_miobase.py +32 -0
- scipy/io/matlab/tests/test_pathological.py +33 -0
- scipy/io/matlab/tests/test_streams.py +241 -0
- scipy/io/mmio.py +17 -0
- scipy/io/netcdf.py +17 -0
- scipy/io/tests/__init__.py +0 -0
- scipy/io/tests/data/Transparent Busy.ani +0 -0
- scipy/io/tests/data/array_float32_1d.sav +0 -0
- scipy/io/tests/data/array_float32_2d.sav +0 -0
- scipy/io/tests/data/array_float32_3d.sav +0 -0
- scipy/io/tests/data/array_float32_4d.sav +0 -0
- scipy/io/tests/data/array_float32_5d.sav +0 -0
- scipy/io/tests/data/array_float32_6d.sav +0 -0
- scipy/io/tests/data/array_float32_7d.sav +0 -0
- scipy/io/tests/data/array_float32_8d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_1d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_2d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_3d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_4d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_5d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_6d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_7d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_8d.sav +0 -0
- scipy/io/tests/data/example_1.nc +0 -0
- scipy/io/tests/data/example_2.nc +0 -0
- scipy/io/tests/data/example_3_maskedvals.nc +0 -0
- scipy/io/tests/data/fortran-3x3d-2i.dat +0 -0
- scipy/io/tests/data/fortran-mixed.dat +0 -0
- scipy/io/tests/data/fortran-sf8-11x1x10.dat +0 -0
- scipy/io/tests/data/fortran-sf8-15x10x22.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x1x1.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x1x5.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x1x7.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x3x5.dat +0 -0
- scipy/io/tests/data/fortran-si4-11x1x10.dat +0 -0
- scipy/io/tests/data/fortran-si4-15x10x22.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x1x1.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x1x5.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x1x7.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x3x5.dat +0 -0
- scipy/io/tests/data/invalid_pointer.sav +0 -0
- scipy/io/tests/data/null_pointer.sav +0 -0
- scipy/io/tests/data/scalar_byte.sav +0 -0
- scipy/io/tests/data/scalar_byte_descr.sav +0 -0
- scipy/io/tests/data/scalar_complex32.sav +0 -0
- scipy/io/tests/data/scalar_complex64.sav +0 -0
- scipy/io/tests/data/scalar_float32.sav +0 -0
- scipy/io/tests/data/scalar_float64.sav +0 -0
- scipy/io/tests/data/scalar_heap_pointer.sav +0 -0
- scipy/io/tests/data/scalar_int16.sav +0 -0
- scipy/io/tests/data/scalar_int32.sav +0 -0
- scipy/io/tests/data/scalar_int64.sav +0 -0
- scipy/io/tests/data/scalar_string.sav +0 -0
- scipy/io/tests/data/scalar_uint16.sav +0 -0
- scipy/io/tests/data/scalar_uint32.sav +0 -0
- scipy/io/tests/data/scalar_uint64.sav +0 -0
- scipy/io/tests/data/struct_arrays.sav +0 -0
- scipy/io/tests/data/struct_arrays_byte_idl80.sav +0 -0
- scipy/io/tests/data/struct_arrays_replicated.sav +0 -0
- scipy/io/tests/data/struct_arrays_replicated_3d.sav +0 -0
- scipy/io/tests/data/struct_inherit.sav +0 -0
- scipy/io/tests/data/struct_pointer_arrays.sav +0 -0
- scipy/io/tests/data/struct_pointer_arrays_replicated.sav +0 -0
- scipy/io/tests/data/struct_pointer_arrays_replicated_3d.sav +0 -0
- scipy/io/tests/data/struct_pointers.sav +0 -0
- scipy/io/tests/data/struct_pointers_replicated.sav +0 -0
- scipy/io/tests/data/struct_pointers_replicated_3d.sav +0 -0
- scipy/io/tests/data/struct_scalars.sav +0 -0
- scipy/io/tests/data/struct_scalars_replicated.sav +0 -0
- scipy/io/tests/data/struct_scalars_replicated_3d.sav +0 -0
- scipy/io/tests/data/test-1234Hz-le-1ch-10S-20bit-extra.wav +0 -0
- scipy/io/tests/data/test-44100Hz-2ch-32bit-float-be.wav +0 -0
- scipy/io/tests/data/test-44100Hz-2ch-32bit-float-le.wav +0 -0
- scipy/io/tests/data/test-44100Hz-be-1ch-4bytes.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-early-eof-no-data.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-early-eof.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-incomplete-chunk.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-rf64.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes.wav +0 -0
- scipy/io/tests/data/test-48000Hz-2ch-64bit-float-le-wavex.wav +0 -0
- scipy/io/tests/data/test-8000Hz-be-3ch-5S-24bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-1ch-1byte-ulaw.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-2ch-1byteu.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-24bit-inconsistent.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-24bit-rf64.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-24bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-36bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-45bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-53bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-64bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-4ch-9S-12bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-5ch-9S-5bit.wav +0 -0
- scipy/io/tests/data/various_compressed.sav +0 -0
- scipy/io/tests/test_fortran.py +264 -0
- scipy/io/tests/test_idl.py +483 -0
- scipy/io/tests/test_mmio.py +831 -0
- scipy/io/tests/test_netcdf.py +550 -0
- scipy/io/tests/test_paths.py +93 -0
- scipy/io/tests/test_wavfile.py +501 -0
- scipy/io/wavfile.py +938 -0
- scipy/linalg/__init__.pxd +1 -0
- scipy/linalg/__init__.py +236 -0
- scipy/linalg/_basic.py +2146 -0
- scipy/linalg/_blas_subroutines.h +164 -0
- scipy/linalg/_cythonized_array_utils.cp314-win_arm64.lib +0 -0
- scipy/linalg/_cythonized_array_utils.cp314-win_arm64.pyd +0 -0
- scipy/linalg/_cythonized_array_utils.pxd +40 -0
- scipy/linalg/_cythonized_array_utils.pyi +16 -0
- scipy/linalg/_decomp.py +1645 -0
- scipy/linalg/_decomp_cholesky.py +413 -0
- scipy/linalg/_decomp_cossin.py +236 -0
- scipy/linalg/_decomp_interpolative.cp314-win_arm64.lib +0 -0
- scipy/linalg/_decomp_interpolative.cp314-win_arm64.pyd +0 -0
- scipy/linalg/_decomp_ldl.py +356 -0
- scipy/linalg/_decomp_lu.py +401 -0
- scipy/linalg/_decomp_lu_cython.cp314-win_arm64.lib +0 -0
- scipy/linalg/_decomp_lu_cython.cp314-win_arm64.pyd +0 -0
- scipy/linalg/_decomp_lu_cython.pyi +6 -0
- scipy/linalg/_decomp_polar.py +113 -0
- scipy/linalg/_decomp_qr.py +494 -0
- scipy/linalg/_decomp_qz.py +452 -0
- scipy/linalg/_decomp_schur.py +336 -0
- scipy/linalg/_decomp_svd.py +545 -0
- scipy/linalg/_decomp_update.cp314-win_arm64.lib +0 -0
- scipy/linalg/_decomp_update.cp314-win_arm64.pyd +0 -0
- scipy/linalg/_expm_frechet.py +417 -0
- scipy/linalg/_fblas.cp314-win_arm64.lib +0 -0
- scipy/linalg/_fblas.cp314-win_arm64.pyd +0 -0
- scipy/linalg/_flapack.cp314-win_arm64.lib +0 -0
- scipy/linalg/_flapack.cp314-win_arm64.pyd +0 -0
- scipy/linalg/_lapack_subroutines.h +1521 -0
- scipy/linalg/_linalg_pythran.cp314-win_arm64.lib +0 -0
- scipy/linalg/_linalg_pythran.cp314-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs.py +1050 -0
- scipy/linalg/_matfuncs_expm.cp314-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_expm.cp314-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs_expm.pyi +6 -0
- scipy/linalg/_matfuncs_inv_ssq.py +886 -0
- scipy/linalg/_matfuncs_schur_sqrtm.cp314-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_schur_sqrtm.cp314-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs_sqrtm.py +107 -0
- scipy/linalg/_matfuncs_sqrtm_triu.cp314-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_sqrtm_triu.cp314-win_arm64.pyd +0 -0
- scipy/linalg/_misc.py +191 -0
- scipy/linalg/_procrustes.py +113 -0
- scipy/linalg/_sketches.py +189 -0
- scipy/linalg/_solve_toeplitz.cp314-win_arm64.lib +0 -0
- scipy/linalg/_solve_toeplitz.cp314-win_arm64.pyd +0 -0
- scipy/linalg/_solvers.py +862 -0
- scipy/linalg/_special_matrices.py +1322 -0
- scipy/linalg/_testutils.py +65 -0
- scipy/linalg/basic.py +23 -0
- scipy/linalg/blas.py +495 -0
- scipy/linalg/cython_blas.cp314-win_arm64.lib +0 -0
- scipy/linalg/cython_blas.cp314-win_arm64.pyd +0 -0
- scipy/linalg/cython_blas.pxd +169 -0
- scipy/linalg/cython_blas.pyx +1432 -0
- scipy/linalg/cython_lapack.cp314-win_arm64.lib +0 -0
- scipy/linalg/cython_lapack.cp314-win_arm64.pyd +0 -0
- scipy/linalg/cython_lapack.pxd +1528 -0
- scipy/linalg/cython_lapack.pyx +12045 -0
- scipy/linalg/decomp.py +23 -0
- scipy/linalg/decomp_cholesky.py +21 -0
- scipy/linalg/decomp_lu.py +21 -0
- scipy/linalg/decomp_qr.py +20 -0
- scipy/linalg/decomp_schur.py +21 -0
- scipy/linalg/decomp_svd.py +21 -0
- scipy/linalg/interpolative.py +989 -0
- scipy/linalg/lapack.py +1081 -0
- scipy/linalg/matfuncs.py +23 -0
- scipy/linalg/misc.py +21 -0
- scipy/linalg/special_matrices.py +22 -0
- scipy/linalg/tests/__init__.py +0 -0
- scipy/linalg/tests/_cython_examples/extending.pyx +23 -0
- scipy/linalg/tests/_cython_examples/meson.build +34 -0
- scipy/linalg/tests/data/carex_15_data.npz +0 -0
- scipy/linalg/tests/data/carex_18_data.npz +0 -0
- scipy/linalg/tests/data/carex_19_data.npz +0 -0
- scipy/linalg/tests/data/carex_20_data.npz +0 -0
- scipy/linalg/tests/data/carex_6_data.npz +0 -0
- scipy/linalg/tests/data/gendare_20170120_data.npz +0 -0
- scipy/linalg/tests/test_basic.py +2074 -0
- scipy/linalg/tests/test_batch.py +588 -0
- scipy/linalg/tests/test_blas.py +1127 -0
- scipy/linalg/tests/test_cython_blas.py +118 -0
- scipy/linalg/tests/test_cython_lapack.py +22 -0
- scipy/linalg/tests/test_cythonized_array_utils.py +130 -0
- scipy/linalg/tests/test_decomp.py +3189 -0
- scipy/linalg/tests/test_decomp_cholesky.py +268 -0
- scipy/linalg/tests/test_decomp_cossin.py +314 -0
- scipy/linalg/tests/test_decomp_ldl.py +137 -0
- scipy/linalg/tests/test_decomp_lu.py +308 -0
- scipy/linalg/tests/test_decomp_polar.py +110 -0
- scipy/linalg/tests/test_decomp_update.py +1701 -0
- scipy/linalg/tests/test_extending.py +46 -0
- scipy/linalg/tests/test_fblas.py +607 -0
- scipy/linalg/tests/test_interpolative.py +232 -0
- scipy/linalg/tests/test_lapack.py +3620 -0
- scipy/linalg/tests/test_matfuncs.py +1125 -0
- scipy/linalg/tests/test_matmul_toeplitz.py +136 -0
- scipy/linalg/tests/test_procrustes.py +214 -0
- scipy/linalg/tests/test_sketches.py +118 -0
- scipy/linalg/tests/test_solve_toeplitz.py +150 -0
- scipy/linalg/tests/test_solvers.py +844 -0
- scipy/linalg/tests/test_special_matrices.py +636 -0
- scipy/misc/__init__.py +6 -0
- scipy/misc/common.py +6 -0
- scipy/misc/doccer.py +6 -0
- scipy/ndimage/__init__.py +174 -0
- scipy/ndimage/_ctest.cp314-win_arm64.lib +0 -0
- scipy/ndimage/_ctest.cp314-win_arm64.pyd +0 -0
- scipy/ndimage/_cytest.cp314-win_arm64.lib +0 -0
- scipy/ndimage/_cytest.cp314-win_arm64.pyd +0 -0
- scipy/ndimage/_delegators.py +303 -0
- scipy/ndimage/_filters.py +2422 -0
- scipy/ndimage/_fourier.py +306 -0
- scipy/ndimage/_interpolation.py +1033 -0
- scipy/ndimage/_measurements.py +1689 -0
- scipy/ndimage/_morphology.py +2634 -0
- scipy/ndimage/_nd_image.cp314-win_arm64.lib +0 -0
- scipy/ndimage/_nd_image.cp314-win_arm64.pyd +0 -0
- scipy/ndimage/_ndimage_api.py +16 -0
- scipy/ndimage/_ni_docstrings.py +214 -0
- scipy/ndimage/_ni_label.cp314-win_arm64.lib +0 -0
- scipy/ndimage/_ni_label.cp314-win_arm64.pyd +0 -0
- scipy/ndimage/_ni_support.py +139 -0
- scipy/ndimage/_rank_filter_1d.cp314-win_arm64.lib +0 -0
- scipy/ndimage/_rank_filter_1d.cp314-win_arm64.pyd +0 -0
- scipy/ndimage/_support_alternative_backends.py +84 -0
- scipy/ndimage/filters.py +27 -0
- scipy/ndimage/fourier.py +21 -0
- scipy/ndimage/interpolation.py +22 -0
- scipy/ndimage/measurements.py +24 -0
- scipy/ndimage/morphology.py +27 -0
- scipy/ndimage/tests/__init__.py +12 -0
- scipy/ndimage/tests/data/label_inputs.txt +21 -0
- scipy/ndimage/tests/data/label_results.txt +294 -0
- scipy/ndimage/tests/data/label_strels.txt +42 -0
- scipy/ndimage/tests/dots.png +0 -0
- scipy/ndimage/tests/test_c_api.py +102 -0
- scipy/ndimage/tests/test_datatypes.py +67 -0
- scipy/ndimage/tests/test_filters.py +3083 -0
- scipy/ndimage/tests/test_fourier.py +187 -0
- scipy/ndimage/tests/test_interpolation.py +1491 -0
- scipy/ndimage/tests/test_measurements.py +1592 -0
- scipy/ndimage/tests/test_morphology.py +2950 -0
- scipy/ndimage/tests/test_ni_support.py +78 -0
- scipy/ndimage/tests/test_splines.py +70 -0
- scipy/odr/__init__.py +131 -0
- scipy/odr/__odrpack.cp314-win_arm64.lib +0 -0
- scipy/odr/__odrpack.cp314-win_arm64.pyd +0 -0
- scipy/odr/_add_newdocs.py +34 -0
- scipy/odr/_models.py +315 -0
- scipy/odr/_odrpack.py +1154 -0
- scipy/odr/models.py +20 -0
- scipy/odr/odrpack.py +21 -0
- scipy/odr/tests/__init__.py +0 -0
- scipy/odr/tests/test_odr.py +607 -0
- scipy/optimize/__init__.pxd +1 -0
- scipy/optimize/__init__.py +460 -0
- scipy/optimize/_basinhopping.py +741 -0
- scipy/optimize/_bglu_dense.cp314-win_arm64.lib +0 -0
- scipy/optimize/_bglu_dense.cp314-win_arm64.pyd +0 -0
- scipy/optimize/_bracket.py +706 -0
- scipy/optimize/_chandrupatla.py +551 -0
- scipy/optimize/_cobyla_py.py +297 -0
- scipy/optimize/_cobyqa_py.py +72 -0
- scipy/optimize/_constraints.py +598 -0
- scipy/optimize/_dcsrch.py +728 -0
- scipy/optimize/_differentiable_functions.py +835 -0
- scipy/optimize/_differentialevolution.py +1970 -0
- scipy/optimize/_direct.cp314-win_arm64.lib +0 -0
- scipy/optimize/_direct.cp314-win_arm64.pyd +0 -0
- scipy/optimize/_direct_py.py +280 -0
- scipy/optimize/_dual_annealing.py +732 -0
- scipy/optimize/_elementwise.py +798 -0
- scipy/optimize/_group_columns.cp314-win_arm64.lib +0 -0
- scipy/optimize/_group_columns.cp314-win_arm64.pyd +0 -0
- scipy/optimize/_hessian_update_strategy.py +479 -0
- scipy/optimize/_highspy/__init__.py +0 -0
- scipy/optimize/_highspy/_core.cp314-win_arm64.lib +0 -0
- scipy/optimize/_highspy/_core.cp314-win_arm64.pyd +0 -0
- scipy/optimize/_highspy/_highs_options.cp314-win_arm64.lib +0 -0
- scipy/optimize/_highspy/_highs_options.cp314-win_arm64.pyd +0 -0
- scipy/optimize/_highspy/_highs_wrapper.py +338 -0
- scipy/optimize/_isotonic.py +157 -0
- scipy/optimize/_lbfgsb.cp314-win_arm64.lib +0 -0
- scipy/optimize/_lbfgsb.cp314-win_arm64.pyd +0 -0
- scipy/optimize/_lbfgsb_py.py +634 -0
- scipy/optimize/_linesearch.py +896 -0
- scipy/optimize/_linprog.py +733 -0
- scipy/optimize/_linprog_doc.py +1434 -0
- scipy/optimize/_linprog_highs.py +422 -0
- scipy/optimize/_linprog_ip.py +1141 -0
- scipy/optimize/_linprog_rs.py +572 -0
- scipy/optimize/_linprog_simplex.py +663 -0
- scipy/optimize/_linprog_util.py +1521 -0
- scipy/optimize/_lsap.cp314-win_arm64.lib +0 -0
- scipy/optimize/_lsap.cp314-win_arm64.pyd +0 -0
- scipy/optimize/_lsq/__init__.py +5 -0
- scipy/optimize/_lsq/bvls.py +183 -0
- scipy/optimize/_lsq/common.py +731 -0
- scipy/optimize/_lsq/dogbox.py +345 -0
- scipy/optimize/_lsq/givens_elimination.cp314-win_arm64.lib +0 -0
- scipy/optimize/_lsq/givens_elimination.cp314-win_arm64.pyd +0 -0
- scipy/optimize/_lsq/least_squares.py +1044 -0
- scipy/optimize/_lsq/lsq_linear.py +361 -0
- scipy/optimize/_lsq/trf.py +587 -0
- scipy/optimize/_lsq/trf_linear.py +249 -0
- scipy/optimize/_milp.py +394 -0
- scipy/optimize/_minimize.py +1199 -0
- scipy/optimize/_minpack.cp314-win_arm64.lib +0 -0
- scipy/optimize/_minpack.cp314-win_arm64.pyd +0 -0
- scipy/optimize/_minpack_py.py +1178 -0
- scipy/optimize/_moduleTNC.cp314-win_arm64.lib +0 -0
- scipy/optimize/_moduleTNC.cp314-win_arm64.pyd +0 -0
- scipy/optimize/_nnls.py +96 -0
- scipy/optimize/_nonlin.py +1634 -0
- scipy/optimize/_numdiff.py +963 -0
- scipy/optimize/_optimize.py +4169 -0
- scipy/optimize/_pava_pybind.cp314-win_arm64.lib +0 -0
- scipy/optimize/_pava_pybind.cp314-win_arm64.pyd +0 -0
- scipy/optimize/_qap.py +760 -0
- scipy/optimize/_remove_redundancy.py +522 -0
- scipy/optimize/_root.py +732 -0
- scipy/optimize/_root_scalar.py +538 -0
- scipy/optimize/_shgo.py +1606 -0
- scipy/optimize/_shgo_lib/__init__.py +0 -0
- scipy/optimize/_shgo_lib/_complex.py +1225 -0
- scipy/optimize/_shgo_lib/_vertex.py +460 -0
- scipy/optimize/_slsqp_py.py +603 -0
- scipy/optimize/_slsqplib.cp314-win_arm64.lib +0 -0
- scipy/optimize/_slsqplib.cp314-win_arm64.pyd +0 -0
- scipy/optimize/_spectral.py +260 -0
- scipy/optimize/_tnc.py +438 -0
- scipy/optimize/_trlib/__init__.py +12 -0
- scipy/optimize/_trlib/_trlib.cp314-win_arm64.lib +0 -0
- scipy/optimize/_trlib/_trlib.cp314-win_arm64.pyd +0 -0
- scipy/optimize/_trustregion.py +318 -0
- scipy/optimize/_trustregion_constr/__init__.py +6 -0
- scipy/optimize/_trustregion_constr/canonical_constraint.py +390 -0
- scipy/optimize/_trustregion_constr/equality_constrained_sqp.py +231 -0
- scipy/optimize/_trustregion_constr/minimize_trustregion_constr.py +584 -0
- scipy/optimize/_trustregion_constr/projections.py +411 -0
- scipy/optimize/_trustregion_constr/qp_subproblem.py +637 -0
- scipy/optimize/_trustregion_constr/report.py +49 -0
- scipy/optimize/_trustregion_constr/tests/__init__.py +0 -0
- scipy/optimize/_trustregion_constr/tests/test_canonical_constraint.py +296 -0
- scipy/optimize/_trustregion_constr/tests/test_nested_minimize.py +39 -0
- scipy/optimize/_trustregion_constr/tests/test_projections.py +214 -0
- scipy/optimize/_trustregion_constr/tests/test_qp_subproblem.py +645 -0
- scipy/optimize/_trustregion_constr/tests/test_report.py +34 -0
- scipy/optimize/_trustregion_constr/tr_interior_point.py +361 -0
- scipy/optimize/_trustregion_dogleg.py +122 -0
- scipy/optimize/_trustregion_exact.py +437 -0
- scipy/optimize/_trustregion_krylov.py +65 -0
- scipy/optimize/_trustregion_ncg.py +126 -0
- scipy/optimize/_tstutils.py +972 -0
- scipy/optimize/_zeros.cp314-win_arm64.lib +0 -0
- scipy/optimize/_zeros.cp314-win_arm64.pyd +0 -0
- scipy/optimize/_zeros_py.py +1475 -0
- scipy/optimize/cobyla.py +19 -0
- scipy/optimize/cython_optimize/__init__.py +133 -0
- scipy/optimize/cython_optimize/_zeros.cp314-win_arm64.lib +0 -0
- scipy/optimize/cython_optimize/_zeros.cp314-win_arm64.pyd +0 -0
- scipy/optimize/cython_optimize/_zeros.pxd +33 -0
- scipy/optimize/cython_optimize/c_zeros.pxd +26 -0
- scipy/optimize/cython_optimize.pxd +11 -0
- scipy/optimize/elementwise.py +38 -0
- scipy/optimize/lbfgsb.py +23 -0
- scipy/optimize/linesearch.py +18 -0
- scipy/optimize/minpack.py +27 -0
- scipy/optimize/minpack2.py +17 -0
- scipy/optimize/moduleTNC.py +19 -0
- scipy/optimize/nonlin.py +29 -0
- scipy/optimize/optimize.py +40 -0
- scipy/optimize/slsqp.py +22 -0
- scipy/optimize/tests/__init__.py +0 -0
- scipy/optimize/tests/_cython_examples/extending.pyx +43 -0
- scipy/optimize/tests/_cython_examples/meson.build +32 -0
- scipy/optimize/tests/test__basinhopping.py +535 -0
- scipy/optimize/tests/test__differential_evolution.py +1703 -0
- scipy/optimize/tests/test__dual_annealing.py +416 -0
- scipy/optimize/tests/test__linprog_clean_inputs.py +312 -0
- scipy/optimize/tests/test__numdiff.py +885 -0
- scipy/optimize/tests/test__remove_redundancy.py +228 -0
- scipy/optimize/tests/test__root.py +124 -0
- scipy/optimize/tests/test__shgo.py +1164 -0
- scipy/optimize/tests/test__spectral.py +226 -0
- scipy/optimize/tests/test_bracket.py +896 -0
- scipy/optimize/tests/test_chandrupatla.py +982 -0
- scipy/optimize/tests/test_cobyla.py +195 -0
- scipy/optimize/tests/test_cobyqa.py +252 -0
- scipy/optimize/tests/test_constraint_conversion.py +286 -0
- scipy/optimize/tests/test_constraints.py +255 -0
- scipy/optimize/tests/test_cython_optimize.py +92 -0
- scipy/optimize/tests/test_differentiable_functions.py +1025 -0
- scipy/optimize/tests/test_direct.py +321 -0
- scipy/optimize/tests/test_extending.py +28 -0
- scipy/optimize/tests/test_hessian_update_strategy.py +300 -0
- scipy/optimize/tests/test_isotonic_regression.py +167 -0
- scipy/optimize/tests/test_lbfgsb_hessinv.py +65 -0
- scipy/optimize/tests/test_lbfgsb_setulb.py +122 -0
- scipy/optimize/tests/test_least_squares.py +986 -0
- scipy/optimize/tests/test_linear_assignment.py +116 -0
- scipy/optimize/tests/test_linesearch.py +328 -0
- scipy/optimize/tests/test_linprog.py +2577 -0
- scipy/optimize/tests/test_lsq_common.py +297 -0
- scipy/optimize/tests/test_lsq_linear.py +287 -0
- scipy/optimize/tests/test_milp.py +459 -0
- scipy/optimize/tests/test_minimize_constrained.py +845 -0
- scipy/optimize/tests/test_minpack.py +1194 -0
- scipy/optimize/tests/test_nnls.py +469 -0
- scipy/optimize/tests/test_nonlin.py +572 -0
- scipy/optimize/tests/test_optimize.py +3344 -0
- scipy/optimize/tests/test_quadratic_assignment.py +455 -0
- scipy/optimize/tests/test_regression.py +40 -0
- scipy/optimize/tests/test_slsqp.py +645 -0
- scipy/optimize/tests/test_tnc.py +345 -0
- scipy/optimize/tests/test_trustregion.py +110 -0
- scipy/optimize/tests/test_trustregion_exact.py +351 -0
- scipy/optimize/tests/test_trustregion_krylov.py +170 -0
- scipy/optimize/tests/test_zeros.py +998 -0
- scipy/optimize/tnc.py +22 -0
- scipy/optimize/zeros.py +26 -0
- scipy/signal/__init__.py +316 -0
- scipy/signal/_arraytools.py +264 -0
- scipy/signal/_czt.py +575 -0
- scipy/signal/_delegators.py +568 -0
- scipy/signal/_filter_design.py +5893 -0
- scipy/signal/_fir_filter_design.py +1458 -0
- scipy/signal/_lti_conversion.py +534 -0
- scipy/signal/_ltisys.py +3546 -0
- scipy/signal/_max_len_seq.py +139 -0
- scipy/signal/_max_len_seq_inner.cp314-win_arm64.lib +0 -0
- scipy/signal/_max_len_seq_inner.cp314-win_arm64.pyd +0 -0
- scipy/signal/_peak_finding.py +1310 -0
- scipy/signal/_peak_finding_utils.cp314-win_arm64.lib +0 -0
- scipy/signal/_peak_finding_utils.cp314-win_arm64.pyd +0 -0
- scipy/signal/_polyutils.py +172 -0
- scipy/signal/_savitzky_golay.py +357 -0
- scipy/signal/_short_time_fft.py +2228 -0
- scipy/signal/_signal_api.py +30 -0
- scipy/signal/_signaltools.py +5309 -0
- scipy/signal/_sigtools.cp314-win_arm64.lib +0 -0
- scipy/signal/_sigtools.cp314-win_arm64.pyd +0 -0
- scipy/signal/_sosfilt.cp314-win_arm64.lib +0 -0
- scipy/signal/_sosfilt.cp314-win_arm64.pyd +0 -0
- scipy/signal/_spectral_py.py +2471 -0
- scipy/signal/_spline.cp314-win_arm64.lib +0 -0
- scipy/signal/_spline.cp314-win_arm64.pyd +0 -0
- scipy/signal/_spline.pyi +34 -0
- scipy/signal/_spline_filters.py +848 -0
- scipy/signal/_support_alternative_backends.py +73 -0
- scipy/signal/_upfirdn.py +219 -0
- scipy/signal/_upfirdn_apply.cp314-win_arm64.lib +0 -0
- scipy/signal/_upfirdn_apply.cp314-win_arm64.pyd +0 -0
- scipy/signal/_waveforms.py +687 -0
- scipy/signal/_wavelets.py +29 -0
- scipy/signal/bsplines.py +21 -0
- scipy/signal/filter_design.py +28 -0
- scipy/signal/fir_filter_design.py +21 -0
- scipy/signal/lti_conversion.py +20 -0
- scipy/signal/ltisys.py +25 -0
- scipy/signal/signaltools.py +27 -0
- scipy/signal/spectral.py +21 -0
- scipy/signal/spline.py +18 -0
- scipy/signal/tests/__init__.py +0 -0
- scipy/signal/tests/_scipy_spectral_test_shim.py +311 -0
- scipy/signal/tests/mpsig.py +122 -0
- scipy/signal/tests/test_array_tools.py +111 -0
- scipy/signal/tests/test_bsplines.py +365 -0
- scipy/signal/tests/test_cont2discrete.py +424 -0
- scipy/signal/tests/test_czt.py +221 -0
- scipy/signal/tests/test_dltisys.py +599 -0
- scipy/signal/tests/test_filter_design.py +4744 -0
- scipy/signal/tests/test_fir_filter_design.py +851 -0
- scipy/signal/tests/test_ltisys.py +1225 -0
- scipy/signal/tests/test_max_len_seq.py +71 -0
- scipy/signal/tests/test_peak_finding.py +915 -0
- scipy/signal/tests/test_result_type.py +51 -0
- scipy/signal/tests/test_savitzky_golay.py +363 -0
- scipy/signal/tests/test_short_time_fft.py +1107 -0
- scipy/signal/tests/test_signaltools.py +4735 -0
- scipy/signal/tests/test_spectral.py +2141 -0
- scipy/signal/tests/test_splines.py +427 -0
- scipy/signal/tests/test_upfirdn.py +322 -0
- scipy/signal/tests/test_waveforms.py +400 -0
- scipy/signal/tests/test_wavelets.py +59 -0
- scipy/signal/tests/test_windows.py +987 -0
- scipy/signal/waveforms.py +20 -0
- scipy/signal/wavelets.py +17 -0
- scipy/signal/windows/__init__.py +52 -0
- scipy/signal/windows/_windows.py +2513 -0
- scipy/signal/windows/windows.py +23 -0
- scipy/sparse/__init__.py +350 -0
- scipy/sparse/_base.py +1613 -0
- scipy/sparse/_bsr.py +880 -0
- scipy/sparse/_compressed.py +1328 -0
- scipy/sparse/_construct.py +1454 -0
- scipy/sparse/_coo.py +1581 -0
- scipy/sparse/_csc.py +367 -0
- scipy/sparse/_csparsetools.cp314-win_arm64.lib +0 -0
- scipy/sparse/_csparsetools.cp314-win_arm64.pyd +0 -0
- scipy/sparse/_csr.py +558 -0
- scipy/sparse/_data.py +569 -0
- scipy/sparse/_dia.py +677 -0
- scipy/sparse/_dok.py +669 -0
- scipy/sparse/_extract.py +178 -0
- scipy/sparse/_index.py +444 -0
- scipy/sparse/_lil.py +632 -0
- scipy/sparse/_matrix.py +169 -0
- scipy/sparse/_matrix_io.py +167 -0
- scipy/sparse/_sparsetools.cp314-win_arm64.lib +0 -0
- scipy/sparse/_sparsetools.cp314-win_arm64.pyd +0 -0
- scipy/sparse/_spfuncs.py +76 -0
- scipy/sparse/_sputils.py +632 -0
- scipy/sparse/base.py +24 -0
- scipy/sparse/bsr.py +22 -0
- scipy/sparse/compressed.py +20 -0
- scipy/sparse/construct.py +38 -0
- scipy/sparse/coo.py +23 -0
- scipy/sparse/csc.py +22 -0
- scipy/sparse/csgraph/__init__.py +210 -0
- scipy/sparse/csgraph/_flow.cp314-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_flow.cp314-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_laplacian.py +563 -0
- scipy/sparse/csgraph/_matching.cp314-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_matching.cp314-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_min_spanning_tree.cp314-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_min_spanning_tree.cp314-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_reordering.cp314-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_reordering.cp314-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_shortest_path.cp314-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_shortest_path.cp314-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_tools.cp314-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_tools.cp314-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_traversal.cp314-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_traversal.cp314-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_validation.py +66 -0
- scipy/sparse/csgraph/tests/__init__.py +0 -0
- scipy/sparse/csgraph/tests/test_connected_components.py +119 -0
- scipy/sparse/csgraph/tests/test_conversions.py +61 -0
- scipy/sparse/csgraph/tests/test_flow.py +209 -0
- scipy/sparse/csgraph/tests/test_graph_laplacian.py +368 -0
- scipy/sparse/csgraph/tests/test_matching.py +307 -0
- scipy/sparse/csgraph/tests/test_pydata_sparse.py +197 -0
- scipy/sparse/csgraph/tests/test_reordering.py +70 -0
- scipy/sparse/csgraph/tests/test_shortest_path.py +540 -0
- scipy/sparse/csgraph/tests/test_spanning_tree.py +66 -0
- scipy/sparse/csgraph/tests/test_traversal.py +148 -0
- scipy/sparse/csr.py +22 -0
- scipy/sparse/data.py +18 -0
- scipy/sparse/dia.py +22 -0
- scipy/sparse/dok.py +22 -0
- scipy/sparse/extract.py +23 -0
- scipy/sparse/lil.py +22 -0
- scipy/sparse/linalg/__init__.py +148 -0
- scipy/sparse/linalg/_dsolve/__init__.py +71 -0
- scipy/sparse/linalg/_dsolve/_add_newdocs.py +147 -0
- scipy/sparse/linalg/_dsolve/_superlu.cp314-win_arm64.lib +0 -0
- scipy/sparse/linalg/_dsolve/_superlu.cp314-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_dsolve/linsolve.py +882 -0
- scipy/sparse/linalg/_dsolve/tests/__init__.py +0 -0
- scipy/sparse/linalg/_dsolve/tests/test_linsolve.py +928 -0
- scipy/sparse/linalg/_eigen/__init__.py +22 -0
- scipy/sparse/linalg/_eigen/_svds.py +540 -0
- scipy/sparse/linalg/_eigen/_svds_doc.py +382 -0
- scipy/sparse/linalg/_eigen/arpack/COPYING +45 -0
- scipy/sparse/linalg/_eigen/arpack/__init__.py +20 -0
- scipy/sparse/linalg/_eigen/arpack/_arpack.cp314-win_arm64.lib +0 -0
- scipy/sparse/linalg/_eigen/arpack/_arpack.cp314-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_eigen/arpack/arpack.py +1706 -0
- scipy/sparse/linalg/_eigen/arpack/tests/__init__.py +0 -0
- scipy/sparse/linalg/_eigen/arpack/tests/test_arpack.py +717 -0
- scipy/sparse/linalg/_eigen/lobpcg/__init__.py +16 -0
- scipy/sparse/linalg/_eigen/lobpcg/lobpcg.py +1110 -0
- scipy/sparse/linalg/_eigen/lobpcg/tests/__init__.py +0 -0
- scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py +725 -0
- scipy/sparse/linalg/_eigen/tests/__init__.py +0 -0
- scipy/sparse/linalg/_eigen/tests/test_svds.py +886 -0
- scipy/sparse/linalg/_expm_multiply.py +816 -0
- scipy/sparse/linalg/_interface.py +920 -0
- scipy/sparse/linalg/_isolve/__init__.py +20 -0
- scipy/sparse/linalg/_isolve/_gcrotmk.py +503 -0
- scipy/sparse/linalg/_isolve/iterative.py +1051 -0
- scipy/sparse/linalg/_isolve/lgmres.py +230 -0
- scipy/sparse/linalg/_isolve/lsmr.py +486 -0
- scipy/sparse/linalg/_isolve/lsqr.py +589 -0
- scipy/sparse/linalg/_isolve/minres.py +372 -0
- scipy/sparse/linalg/_isolve/tests/__init__.py +0 -0
- scipy/sparse/linalg/_isolve/tests/test_gcrotmk.py +183 -0
- scipy/sparse/linalg/_isolve/tests/test_iterative.py +809 -0
- scipy/sparse/linalg/_isolve/tests/test_lgmres.py +225 -0
- scipy/sparse/linalg/_isolve/tests/test_lsmr.py +185 -0
- scipy/sparse/linalg/_isolve/tests/test_lsqr.py +120 -0
- scipy/sparse/linalg/_isolve/tests/test_minres.py +97 -0
- scipy/sparse/linalg/_isolve/tests/test_utils.py +9 -0
- scipy/sparse/linalg/_isolve/tfqmr.py +179 -0
- scipy/sparse/linalg/_isolve/utils.py +121 -0
- scipy/sparse/linalg/_matfuncs.py +940 -0
- scipy/sparse/linalg/_norm.py +195 -0
- scipy/sparse/linalg/_onenormest.py +467 -0
- scipy/sparse/linalg/_propack/_cpropack.cp314-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_cpropack.cp314-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_dpropack.cp314-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_dpropack.cp314-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_spropack.cp314-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_spropack.cp314-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_zpropack.cp314-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_zpropack.cp314-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_special_sparse_arrays.py +949 -0
- scipy/sparse/linalg/_svdp.py +309 -0
- scipy/sparse/linalg/dsolve.py +22 -0
- scipy/sparse/linalg/eigen.py +21 -0
- scipy/sparse/linalg/interface.py +20 -0
- scipy/sparse/linalg/isolve.py +22 -0
- scipy/sparse/linalg/matfuncs.py +18 -0
- scipy/sparse/linalg/tests/__init__.py +0 -0
- scipy/sparse/linalg/tests/propack_test_data.npz +0 -0
- scipy/sparse/linalg/tests/test_expm_multiply.py +367 -0
- scipy/sparse/linalg/tests/test_interface.py +561 -0
- scipy/sparse/linalg/tests/test_matfuncs.py +592 -0
- scipy/sparse/linalg/tests/test_norm.py +154 -0
- scipy/sparse/linalg/tests/test_onenormest.py +252 -0
- scipy/sparse/linalg/tests/test_propack.py +165 -0
- scipy/sparse/linalg/tests/test_pydata_sparse.py +272 -0
- scipy/sparse/linalg/tests/test_special_sparse_arrays.py +337 -0
- scipy/sparse/sparsetools.py +17 -0
- scipy/sparse/spfuncs.py +17 -0
- scipy/sparse/sputils.py +17 -0
- scipy/sparse/tests/__init__.py +0 -0
- scipy/sparse/tests/data/csc_py2.npz +0 -0
- scipy/sparse/tests/data/csc_py3.npz +0 -0
- scipy/sparse/tests/test_arithmetic1d.py +341 -0
- scipy/sparse/tests/test_array_api.py +561 -0
- scipy/sparse/tests/test_base.py +5870 -0
- scipy/sparse/tests/test_common1d.py +447 -0
- scipy/sparse/tests/test_construct.py +872 -0
- scipy/sparse/tests/test_coo.py +1119 -0
- scipy/sparse/tests/test_csc.py +98 -0
- scipy/sparse/tests/test_csr.py +214 -0
- scipy/sparse/tests/test_dok.py +209 -0
- scipy/sparse/tests/test_extract.py +51 -0
- scipy/sparse/tests/test_indexing1d.py +603 -0
- scipy/sparse/tests/test_matrix_io.py +109 -0
- scipy/sparse/tests/test_minmax1d.py +128 -0
- scipy/sparse/tests/test_sparsetools.py +344 -0
- scipy/sparse/tests/test_spfuncs.py +97 -0
- scipy/sparse/tests/test_sputils.py +424 -0
- scipy/spatial/__init__.py +129 -0
- scipy/spatial/_ckdtree.cp314-win_arm64.lib +0 -0
- scipy/spatial/_ckdtree.cp314-win_arm64.pyd +0 -0
- scipy/spatial/_distance_pybind.cp314-win_arm64.lib +0 -0
- scipy/spatial/_distance_pybind.cp314-win_arm64.pyd +0 -0
- scipy/spatial/_distance_wrap.cp314-win_arm64.lib +0 -0
- scipy/spatial/_distance_wrap.cp314-win_arm64.pyd +0 -0
- scipy/spatial/_geometric_slerp.py +238 -0
- scipy/spatial/_hausdorff.cp314-win_arm64.lib +0 -0
- scipy/spatial/_hausdorff.cp314-win_arm64.pyd +0 -0
- scipy/spatial/_kdtree.py +920 -0
- scipy/spatial/_plotutils.py +274 -0
- scipy/spatial/_procrustes.py +132 -0
- scipy/spatial/_qhull.cp314-win_arm64.lib +0 -0
- scipy/spatial/_qhull.cp314-win_arm64.pyd +0 -0
- scipy/spatial/_qhull.pyi +213 -0
- scipy/spatial/_spherical_voronoi.py +341 -0
- scipy/spatial/_voronoi.cp314-win_arm64.lib +0 -0
- scipy/spatial/_voronoi.cp314-win_arm64.pyd +0 -0
- scipy/spatial/_voronoi.pyi +4 -0
- scipy/spatial/ckdtree.py +18 -0
- scipy/spatial/distance.py +3147 -0
- scipy/spatial/distance.pyi +210 -0
- scipy/spatial/kdtree.py +25 -0
- scipy/spatial/qhull.py +25 -0
- scipy/spatial/qhull_src/COPYING_QHULL.txt +39 -0
- scipy/spatial/tests/__init__.py +0 -0
- scipy/spatial/tests/data/cdist-X1.txt +10 -0
- scipy/spatial/tests/data/cdist-X2.txt +20 -0
- scipy/spatial/tests/data/degenerate_pointset.npz +0 -0
- scipy/spatial/tests/data/iris.txt +150 -0
- scipy/spatial/tests/data/pdist-boolean-inp.txt +20 -0
- scipy/spatial/tests/data/pdist-chebyshev-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-chebyshev-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-cityblock-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-cityblock-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-correlation-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-correlation-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-cosine-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-cosine-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-double-inp.txt +20 -0
- scipy/spatial/tests/data/pdist-euclidean-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-euclidean-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-hamming-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-jaccard-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-jensenshannon-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-jensenshannon-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-minkowski-3.2-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-minkowski-3.2-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-minkowski-5.8-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-seuclidean-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-seuclidean-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-spearman-ml.txt +1 -0
- scipy/spatial/tests/data/random-bool-data.txt +100 -0
- scipy/spatial/tests/data/random-double-data.txt +100 -0
- scipy/spatial/tests/data/random-int-data.txt +100 -0
- scipy/spatial/tests/data/random-uint-data.txt +100 -0
- scipy/spatial/tests/data/selfdual-4d-polytope.txt +27 -0
- scipy/spatial/tests/test__plotutils.py +91 -0
- scipy/spatial/tests/test__procrustes.py +116 -0
- scipy/spatial/tests/test_distance.py +2389 -0
- scipy/spatial/tests/test_hausdorff.py +199 -0
- scipy/spatial/tests/test_kdtree.py +1536 -0
- scipy/spatial/tests/test_qhull.py +1313 -0
- scipy/spatial/tests/test_slerp.py +417 -0
- scipy/spatial/tests/test_spherical_voronoi.py +358 -0
- scipy/spatial/transform/__init__.py +31 -0
- scipy/spatial/transform/_rigid_transform.cp314-win_arm64.lib +0 -0
- scipy/spatial/transform/_rigid_transform.cp314-win_arm64.pyd +0 -0
- scipy/spatial/transform/_rotation.cp314-win_arm64.lib +0 -0
- scipy/spatial/transform/_rotation.cp314-win_arm64.pyd +0 -0
- scipy/spatial/transform/_rotation_groups.py +140 -0
- scipy/spatial/transform/_rotation_spline.py +460 -0
- scipy/spatial/transform/rotation.py +21 -0
- scipy/spatial/transform/tests/__init__.py +0 -0
- scipy/spatial/transform/tests/test_rigid_transform.py +1221 -0
- scipy/spatial/transform/tests/test_rotation.py +2569 -0
- scipy/spatial/transform/tests/test_rotation_groups.py +169 -0
- scipy/spatial/transform/tests/test_rotation_spline.py +183 -0
- scipy/special/__init__.pxd +1 -0
- scipy/special/__init__.py +841 -0
- scipy/special/_add_newdocs.py +9961 -0
- scipy/special/_basic.py +3576 -0
- scipy/special/_comb.cp314-win_arm64.lib +0 -0
- scipy/special/_comb.cp314-win_arm64.pyd +0 -0
- scipy/special/_ellip_harm.py +214 -0
- scipy/special/_ellip_harm_2.cp314-win_arm64.lib +0 -0
- scipy/special/_ellip_harm_2.cp314-win_arm64.pyd +0 -0
- scipy/special/_gufuncs.cp314-win_arm64.lib +0 -0
- scipy/special/_gufuncs.cp314-win_arm64.pyd +0 -0
- scipy/special/_input_validation.py +17 -0
- scipy/special/_lambertw.py +149 -0
- scipy/special/_logsumexp.py +426 -0
- scipy/special/_mptestutils.py +453 -0
- scipy/special/_multiufuncs.py +610 -0
- scipy/special/_orthogonal.py +2592 -0
- scipy/special/_orthogonal.pyi +330 -0
- scipy/special/_precompute/__init__.py +0 -0
- scipy/special/_precompute/cosine_cdf.py +17 -0
- scipy/special/_precompute/expn_asy.py +54 -0
- scipy/special/_precompute/gammainc_asy.py +116 -0
- scipy/special/_precompute/gammainc_data.py +124 -0
- scipy/special/_precompute/hyp2f1_data.py +484 -0
- scipy/special/_precompute/lambertw.py +68 -0
- scipy/special/_precompute/loggamma.py +43 -0
- scipy/special/_precompute/struve_convergence.py +131 -0
- scipy/special/_precompute/utils.py +38 -0
- scipy/special/_precompute/wright_bessel.py +342 -0
- scipy/special/_precompute/wright_bessel_data.py +152 -0
- scipy/special/_precompute/wrightomega.py +41 -0
- scipy/special/_precompute/zetac.py +27 -0
- scipy/special/_sf_error.py +15 -0
- scipy/special/_specfun.cp314-win_arm64.lib +0 -0
- scipy/special/_specfun.cp314-win_arm64.pyd +0 -0
- scipy/special/_special_ufuncs.cp314-win_arm64.lib +0 -0
- scipy/special/_special_ufuncs.cp314-win_arm64.pyd +0 -0
- scipy/special/_spfun_stats.py +106 -0
- scipy/special/_spherical_bessel.py +397 -0
- scipy/special/_support_alternative_backends.py +295 -0
- scipy/special/_test_internal.cp314-win_arm64.lib +0 -0
- scipy/special/_test_internal.cp314-win_arm64.pyd +0 -0
- scipy/special/_test_internal.pyi +9 -0
- scipy/special/_testutils.py +321 -0
- scipy/special/_ufuncs.cp314-win_arm64.lib +0 -0
- scipy/special/_ufuncs.cp314-win_arm64.pyd +0 -0
- scipy/special/_ufuncs.pyi +522 -0
- scipy/special/_ufuncs.pyx +13173 -0
- scipy/special/_ufuncs_cxx.cp314-win_arm64.lib +0 -0
- scipy/special/_ufuncs_cxx.cp314-win_arm64.pyd +0 -0
- scipy/special/_ufuncs_cxx.pxd +142 -0
- scipy/special/_ufuncs_cxx.pyx +427 -0
- scipy/special/_ufuncs_cxx_defs.h +147 -0
- scipy/special/_ufuncs_defs.h +57 -0
- scipy/special/add_newdocs.py +15 -0
- scipy/special/basic.py +87 -0
- scipy/special/cython_special.cp314-win_arm64.lib +0 -0
- scipy/special/cython_special.cp314-win_arm64.pyd +0 -0
- scipy/special/cython_special.pxd +259 -0
- scipy/special/cython_special.pyi +3 -0
- scipy/special/orthogonal.py +45 -0
- scipy/special/sf_error.py +20 -0
- scipy/special/specfun.py +24 -0
- scipy/special/spfun_stats.py +17 -0
- scipy/special/tests/__init__.py +0 -0
- scipy/special/tests/_cython_examples/extending.pyx +12 -0
- scipy/special/tests/_cython_examples/meson.build +34 -0
- scipy/special/tests/data/__init__.py +0 -0
- scipy/special/tests/data/boost.npz +0 -0
- scipy/special/tests/data/gsl.npz +0 -0
- scipy/special/tests/data/local.npz +0 -0
- scipy/special/tests/test_basic.py +4815 -0
- scipy/special/tests/test_bdtr.py +112 -0
- scipy/special/tests/test_boost_ufuncs.py +64 -0
- scipy/special/tests/test_boxcox.py +125 -0
- scipy/special/tests/test_cdflib.py +712 -0
- scipy/special/tests/test_cdft_asymptotic.py +49 -0
- scipy/special/tests/test_cephes_intp_cast.py +29 -0
- scipy/special/tests/test_cosine_distr.py +83 -0
- scipy/special/tests/test_cython_special.py +363 -0
- scipy/special/tests/test_data.py +719 -0
- scipy/special/tests/test_dd.py +42 -0
- scipy/special/tests/test_digamma.py +45 -0
- scipy/special/tests/test_ellip_harm.py +278 -0
- scipy/special/tests/test_erfinv.py +89 -0
- scipy/special/tests/test_exponential_integrals.py +118 -0
- scipy/special/tests/test_extending.py +28 -0
- scipy/special/tests/test_faddeeva.py +85 -0
- scipy/special/tests/test_gamma.py +12 -0
- scipy/special/tests/test_gammainc.py +152 -0
- scipy/special/tests/test_hyp2f1.py +2566 -0
- scipy/special/tests/test_hypergeometric.py +234 -0
- scipy/special/tests/test_iv_ratio.py +249 -0
- scipy/special/tests/test_kolmogorov.py +491 -0
- scipy/special/tests/test_lambertw.py +109 -0
- scipy/special/tests/test_legendre.py +1518 -0
- scipy/special/tests/test_log1mexp.py +85 -0
- scipy/special/tests/test_loggamma.py +70 -0
- scipy/special/tests/test_logit.py +162 -0
- scipy/special/tests/test_logsumexp.py +469 -0
- scipy/special/tests/test_mpmath.py +2293 -0
- scipy/special/tests/test_nan_inputs.py +65 -0
- scipy/special/tests/test_ndtr.py +77 -0
- scipy/special/tests/test_ndtri_exp.py +94 -0
- scipy/special/tests/test_orthogonal.py +821 -0
- scipy/special/tests/test_orthogonal_eval.py +275 -0
- scipy/special/tests/test_owens_t.py +53 -0
- scipy/special/tests/test_pcf.py +24 -0
- scipy/special/tests/test_pdtr.py +48 -0
- scipy/special/tests/test_powm1.py +65 -0
- scipy/special/tests/test_precompute_expn_asy.py +24 -0
- scipy/special/tests/test_precompute_gammainc.py +108 -0
- scipy/special/tests/test_precompute_utils.py +36 -0
- scipy/special/tests/test_round.py +18 -0
- scipy/special/tests/test_sf_error.py +146 -0
- scipy/special/tests/test_sici.py +36 -0
- scipy/special/tests/test_specfun.py +48 -0
- scipy/special/tests/test_spence.py +32 -0
- scipy/special/tests/test_spfun_stats.py +61 -0
- scipy/special/tests/test_sph_harm.py +85 -0
- scipy/special/tests/test_spherical_bessel.py +400 -0
- scipy/special/tests/test_support_alternative_backends.py +248 -0
- scipy/special/tests/test_trig.py +72 -0
- scipy/special/tests/test_ufunc_signatures.py +46 -0
- scipy/special/tests/test_wright_bessel.py +205 -0
- scipy/special/tests/test_wrightomega.py +117 -0
- scipy/special/tests/test_zeta.py +301 -0
- scipy/stats/__init__.py +670 -0
- scipy/stats/_ansari_swilk_statistics.cp314-win_arm64.lib +0 -0
- scipy/stats/_ansari_swilk_statistics.cp314-win_arm64.pyd +0 -0
- scipy/stats/_axis_nan_policy.py +692 -0
- scipy/stats/_biasedurn.cp314-win_arm64.lib +0 -0
- scipy/stats/_biasedurn.cp314-win_arm64.pyd +0 -0
- scipy/stats/_biasedurn.pxd +27 -0
- scipy/stats/_binned_statistic.py +795 -0
- scipy/stats/_binomtest.py +375 -0
- scipy/stats/_bws_test.py +177 -0
- scipy/stats/_censored_data.py +459 -0
- scipy/stats/_common.py +5 -0
- scipy/stats/_constants.py +42 -0
- scipy/stats/_continued_fraction.py +387 -0
- scipy/stats/_continuous_distns.py +12486 -0
- scipy/stats/_correlation.py +210 -0
- scipy/stats/_covariance.py +636 -0
- scipy/stats/_crosstab.py +204 -0
- scipy/stats/_discrete_distns.py +2098 -0
- scipy/stats/_distn_infrastructure.py +4201 -0
- scipy/stats/_distr_params.py +299 -0
- scipy/stats/_distribution_infrastructure.py +5750 -0
- scipy/stats/_entropy.py +428 -0
- scipy/stats/_finite_differences.py +145 -0
- scipy/stats/_fit.py +1351 -0
- scipy/stats/_hypotests.py +2060 -0
- scipy/stats/_kde.py +732 -0
- scipy/stats/_ksstats.py +600 -0
- scipy/stats/_levy_stable/__init__.py +1231 -0
- scipy/stats/_levy_stable/levyst.cp314-win_arm64.lib +0 -0
- scipy/stats/_levy_stable/levyst.cp314-win_arm64.pyd +0 -0
- scipy/stats/_mannwhitneyu.py +492 -0
- scipy/stats/_mgc.py +550 -0
- scipy/stats/_morestats.py +4626 -0
- scipy/stats/_mstats_basic.py +3658 -0
- scipy/stats/_mstats_extras.py +521 -0
- scipy/stats/_multicomp.py +449 -0
- scipy/stats/_multivariate.py +7281 -0
- scipy/stats/_new_distributions.py +452 -0
- scipy/stats/_odds_ratio.py +466 -0
- scipy/stats/_page_trend_test.py +486 -0
- scipy/stats/_probability_distribution.py +1964 -0
- scipy/stats/_qmc.py +2956 -0
- scipy/stats/_qmc_cy.cp314-win_arm64.lib +0 -0
- scipy/stats/_qmc_cy.cp314-win_arm64.pyd +0 -0
- scipy/stats/_qmc_cy.pyi +54 -0
- scipy/stats/_qmvnt.py +454 -0
- scipy/stats/_qmvnt_cy.cp314-win_arm64.lib +0 -0
- scipy/stats/_qmvnt_cy.cp314-win_arm64.pyd +0 -0
- scipy/stats/_quantile.py +335 -0
- scipy/stats/_rcont/__init__.py +4 -0
- scipy/stats/_rcont/rcont.cp314-win_arm64.lib +0 -0
- scipy/stats/_rcont/rcont.cp314-win_arm64.pyd +0 -0
- scipy/stats/_relative_risk.py +263 -0
- scipy/stats/_resampling.py +2352 -0
- scipy/stats/_result_classes.py +40 -0
- scipy/stats/_sampling.py +1314 -0
- scipy/stats/_sensitivity_analysis.py +713 -0
- scipy/stats/_sobol.cp314-win_arm64.lib +0 -0
- scipy/stats/_sobol.cp314-win_arm64.pyd +0 -0
- scipy/stats/_sobol.pyi +54 -0
- scipy/stats/_sobol_direction_numbers.npz +0 -0
- scipy/stats/_stats.cp314-win_arm64.lib +0 -0
- scipy/stats/_stats.cp314-win_arm64.pyd +0 -0
- scipy/stats/_stats.pxd +10 -0
- scipy/stats/_stats_mstats_common.py +322 -0
- scipy/stats/_stats_py.py +11089 -0
- scipy/stats/_stats_pythran.cp314-win_arm64.lib +0 -0
- scipy/stats/_stats_pythran.cp314-win_arm64.pyd +0 -0
- scipy/stats/_survival.py +683 -0
- scipy/stats/_tukeylambda_stats.py +199 -0
- scipy/stats/_unuran/__init__.py +0 -0
- scipy/stats/_unuran/unuran_wrapper.cp314-win_arm64.lib +0 -0
- scipy/stats/_unuran/unuran_wrapper.cp314-win_arm64.pyd +0 -0
- scipy/stats/_unuran/unuran_wrapper.pyi +179 -0
- scipy/stats/_variation.py +126 -0
- scipy/stats/_warnings_errors.py +38 -0
- scipy/stats/_wilcoxon.py +265 -0
- scipy/stats/biasedurn.py +16 -0
- scipy/stats/contingency.py +521 -0
- scipy/stats/distributions.py +24 -0
- scipy/stats/kde.py +18 -0
- scipy/stats/morestats.py +27 -0
- scipy/stats/mstats.py +140 -0
- scipy/stats/mstats_basic.py +42 -0
- scipy/stats/mstats_extras.py +25 -0
- scipy/stats/mvn.py +17 -0
- scipy/stats/qmc.py +236 -0
- scipy/stats/sampling.py +73 -0
- scipy/stats/stats.py +41 -0
- scipy/stats/tests/__init__.py +0 -0
- scipy/stats/tests/common_tests.py +356 -0
- scipy/stats/tests/data/_mvt.py +171 -0
- scipy/stats/tests/data/fisher_exact_results_from_r.py +607 -0
- scipy/stats/tests/data/jf_skew_t_gamlss_pdf_data.npy +0 -0
- scipy/stats/tests/data/levy_stable/stable-Z1-cdf-sample-data.npy +0 -0
- scipy/stats/tests/data/levy_stable/stable-Z1-pdf-sample-data.npy +0 -0
- scipy/stats/tests/data/levy_stable/stable-loc-scale-sample-data.npy +0 -0
- scipy/stats/tests/data/nist_anova/AtmWtAg.dat +108 -0
- scipy/stats/tests/data/nist_anova/SiRstv.dat +85 -0
- scipy/stats/tests/data/nist_anova/SmLs01.dat +249 -0
- scipy/stats/tests/data/nist_anova/SmLs02.dat +1869 -0
- scipy/stats/tests/data/nist_anova/SmLs03.dat +18069 -0
- scipy/stats/tests/data/nist_anova/SmLs04.dat +249 -0
- scipy/stats/tests/data/nist_anova/SmLs05.dat +1869 -0
- scipy/stats/tests/data/nist_anova/SmLs06.dat +18069 -0
- scipy/stats/tests/data/nist_anova/SmLs07.dat +249 -0
- scipy/stats/tests/data/nist_anova/SmLs08.dat +1869 -0
- scipy/stats/tests/data/nist_anova/SmLs09.dat +18069 -0
- scipy/stats/tests/data/nist_linregress/Norris.dat +97 -0
- scipy/stats/tests/data/rel_breitwigner_pdf_sample_data_ROOT.npy +0 -0
- scipy/stats/tests/data/studentized_range_mpmath_ref.json +1499 -0
- scipy/stats/tests/test_axis_nan_policy.py +1388 -0
- scipy/stats/tests/test_binned_statistic.py +568 -0
- scipy/stats/tests/test_censored_data.py +152 -0
- scipy/stats/tests/test_contingency.py +294 -0
- scipy/stats/tests/test_continued_fraction.py +173 -0
- scipy/stats/tests/test_continuous.py +2198 -0
- scipy/stats/tests/test_continuous_basic.py +1053 -0
- scipy/stats/tests/test_continuous_fit_censored.py +683 -0
- scipy/stats/tests/test_correlation.py +80 -0
- scipy/stats/tests/test_crosstab.py +115 -0
- scipy/stats/tests/test_discrete_basic.py +580 -0
- scipy/stats/tests/test_discrete_distns.py +700 -0
- scipy/stats/tests/test_distributions.py +10413 -0
- scipy/stats/tests/test_entropy.py +322 -0
- scipy/stats/tests/test_fast_gen_inversion.py +435 -0
- scipy/stats/tests/test_fit.py +1090 -0
- scipy/stats/tests/test_hypotests.py +1991 -0
- scipy/stats/tests/test_kdeoth.py +676 -0
- scipy/stats/tests/test_marray.py +289 -0
- scipy/stats/tests/test_mgc.py +217 -0
- scipy/stats/tests/test_morestats.py +3259 -0
- scipy/stats/tests/test_mstats_basic.py +2071 -0
- scipy/stats/tests/test_mstats_extras.py +172 -0
- scipy/stats/tests/test_multicomp.py +405 -0
- scipy/stats/tests/test_multivariate.py +4381 -0
- scipy/stats/tests/test_odds_ratio.py +148 -0
- scipy/stats/tests/test_qmc.py +1492 -0
- scipy/stats/tests/test_quantile.py +199 -0
- scipy/stats/tests/test_rank.py +345 -0
- scipy/stats/tests/test_relative_risk.py +95 -0
- scipy/stats/tests/test_resampling.py +2000 -0
- scipy/stats/tests/test_sampling.py +1450 -0
- scipy/stats/tests/test_sensitivity_analysis.py +310 -0
- scipy/stats/tests/test_stats.py +9707 -0
- scipy/stats/tests/test_survival.py +466 -0
- scipy/stats/tests/test_tukeylambda_stats.py +85 -0
- scipy/stats/tests/test_variation.py +216 -0
- scipy/version.py +12 -0
- scipy-1.16.2.dist-info/DELVEWHEEL +2 -0
- scipy-1.16.2.dist-info/LICENSE.txt +912 -0
- scipy-1.16.2.dist-info/METADATA +1061 -0
- scipy-1.16.2.dist-info/RECORD +1530 -0
- scipy-1.16.2.dist-info/WHEEL +4 -0
- scipy.libs/msvcp140-5f1c5dd31916990d94181e07bc3afb32.dll +0 -0
- scipy.libs/scipy_openblas-f3ac85b1f412f7e86514c923dc4058d1.dll +0 -0
scipy/stats/_sampling.py
ADDED
@@ -0,0 +1,1314 @@
|
|
1
|
+
import math
|
2
|
+
import numbers
|
3
|
+
import numpy as np
|
4
|
+
from scipy import stats
|
5
|
+
from scipy import special as sc
|
6
|
+
from ._qmc import (check_random_state as check_random_state_qmc,
|
7
|
+
Halton, QMCEngine)
|
8
|
+
from ._unuran.unuran_wrapper import NumericalInversePolynomial
|
9
|
+
from scipy._lib._util import check_random_state
|
10
|
+
|
11
|
+
|
12
|
+
__all__ = ['FastGeneratorInversion', 'RatioUniforms']
|
13
|
+
|
14
|
+
|
15
|
+
# define pdfs and other helper functions to create the generators
|
16
|
+
|
17
|
+
def argus_pdf(x, chi):
|
18
|
+
# approach follows Baumgarten/Hoermann: Generating ARGUS random variates
|
19
|
+
# for chi > 5, use relationship of the ARGUS distribution to Gamma(1.5)
|
20
|
+
if chi <= 5:
|
21
|
+
y = 1 - x * x
|
22
|
+
return x * math.sqrt(y) * math.exp(-0.5 * chi**2 * y)
|
23
|
+
return math.sqrt(x) * math.exp(-x)
|
24
|
+
|
25
|
+
|
26
|
+
def argus_gamma_trf(x, chi):
|
27
|
+
if chi <= 5:
|
28
|
+
return x
|
29
|
+
return np.sqrt(1.0 - 2 * x / chi**2)
|
30
|
+
|
31
|
+
|
32
|
+
def argus_gamma_inv_trf(x, chi):
|
33
|
+
if chi <= 5:
|
34
|
+
return x
|
35
|
+
return 0.5 * chi**2 * (1 - x**2)
|
36
|
+
|
37
|
+
|
38
|
+
def betaprime_pdf(x, a, b):
|
39
|
+
if x > 0:
|
40
|
+
logf = (a - 1) * math.log(x) - (a + b) * math.log1p(x) - sc.betaln(a, b)
|
41
|
+
return math.exp(logf)
|
42
|
+
else:
|
43
|
+
# return pdf at x == 0 separately to avoid runtime warnings
|
44
|
+
if a > 1:
|
45
|
+
return 0
|
46
|
+
elif a < 1:
|
47
|
+
return np.inf
|
48
|
+
else:
|
49
|
+
return 1 / sc.beta(a, b)
|
50
|
+
|
51
|
+
|
52
|
+
def beta_valid_params(a, b):
|
53
|
+
return (min(a, b) >= 0.1) and (max(a, b) <= 700)
|
54
|
+
|
55
|
+
|
56
|
+
def gamma_pdf(x, a):
|
57
|
+
if x > 0:
|
58
|
+
return math.exp(-math.lgamma(a) + (a - 1.0) * math.log(x) - x)
|
59
|
+
else:
|
60
|
+
return 0 if a >= 1 else np.inf
|
61
|
+
|
62
|
+
|
63
|
+
def invgamma_pdf(x, a):
|
64
|
+
if x > 0:
|
65
|
+
return math.exp(-(a + 1.0) * math.log(x) - math.lgamma(a) - 1 / x)
|
66
|
+
else:
|
67
|
+
return 0 if a >= 1 else np.inf
|
68
|
+
|
69
|
+
|
70
|
+
def burr_pdf(x, cc, dd):
|
71
|
+
# note: we use np.exp instead of math.exp, otherwise an overflow
|
72
|
+
# error can occur in the setup, e.g., for parameters
|
73
|
+
# 1.89128135, 0.30195177, see test test_burr_overflow
|
74
|
+
if x > 0:
|
75
|
+
lx = math.log(x)
|
76
|
+
return np.exp(-(cc + 1) * lx - (dd + 1) * math.log1p(np.exp(-cc * lx)))
|
77
|
+
else:
|
78
|
+
return 0
|
79
|
+
|
80
|
+
|
81
|
+
def burr12_pdf(x, cc, dd):
|
82
|
+
if x > 0:
|
83
|
+
lx = math.log(x)
|
84
|
+
logterm = math.log1p(math.exp(cc * lx))
|
85
|
+
return math.exp((cc - 1) * lx - (dd + 1) * logterm + math.log(cc * dd))
|
86
|
+
else:
|
87
|
+
return 0
|
88
|
+
|
89
|
+
|
90
|
+
def chi_pdf(x, a):
|
91
|
+
if x > 0:
|
92
|
+
return math.exp(
|
93
|
+
(a - 1) * math.log(x)
|
94
|
+
- 0.5 * (x * x)
|
95
|
+
- (a / 2 - 1) * math.log(2)
|
96
|
+
- math.lgamma(0.5 * a)
|
97
|
+
)
|
98
|
+
else:
|
99
|
+
return 0 if a >= 1 else np.inf
|
100
|
+
|
101
|
+
|
102
|
+
def chi2_pdf(x, df):
|
103
|
+
if x > 0:
|
104
|
+
return math.exp(
|
105
|
+
(df / 2 - 1) * math.log(x)
|
106
|
+
- 0.5 * x
|
107
|
+
- (df / 2) * math.log(2)
|
108
|
+
- math.lgamma(0.5 * df)
|
109
|
+
)
|
110
|
+
else:
|
111
|
+
return 0 if df >= 1 else np.inf
|
112
|
+
|
113
|
+
|
114
|
+
def alpha_pdf(x, a):
|
115
|
+
if x > 0:
|
116
|
+
return math.exp(-2.0 * math.log(x) - 0.5 * (a - 1.0 / x) ** 2)
|
117
|
+
return 0.0
|
118
|
+
|
119
|
+
|
120
|
+
def bradford_pdf(x, c):
|
121
|
+
if 0 <= x <= 1:
|
122
|
+
return 1.0 / (1.0 + c * x)
|
123
|
+
return 0.0
|
124
|
+
|
125
|
+
|
126
|
+
def crystalball_pdf(x, b, m):
|
127
|
+
if x > -b:
|
128
|
+
return math.exp(-0.5 * x * x)
|
129
|
+
return math.exp(m * math.log(m / b) - 0.5 * b * b - m * math.log(m / b - b - x))
|
130
|
+
|
131
|
+
|
132
|
+
def weibull_min_pdf(x, c):
|
133
|
+
if x > 0:
|
134
|
+
return c * math.exp((c - 1) * math.log(x) - x**c)
|
135
|
+
return 0.0
|
136
|
+
|
137
|
+
|
138
|
+
def weibull_max_pdf(x, c):
|
139
|
+
if x < 0:
|
140
|
+
return c * math.exp((c - 1) * math.log(-x) - ((-x) ** c))
|
141
|
+
return 0.0
|
142
|
+
|
143
|
+
|
144
|
+
def invweibull_pdf(x, c):
|
145
|
+
if x > 0:
|
146
|
+
return c * math.exp(-(c + 1) * math.log(x) - x ** (-c))
|
147
|
+
return 0.0
|
148
|
+
|
149
|
+
|
150
|
+
def wald_pdf(x):
|
151
|
+
if x > 0:
|
152
|
+
return math.exp(-((x - 1) ** 2) / (2 * x)) / math.sqrt(x**3)
|
153
|
+
return 0.0
|
154
|
+
|
155
|
+
|
156
|
+
def geninvgauss_mode(p, b):
|
157
|
+
if p > 1: # equivalent mode formulas numerical more stable versions
|
158
|
+
return (math.sqrt((1 - p) ** 2 + b**2) - (1 - p)) / b
|
159
|
+
return b / (math.sqrt((1 - p) ** 2 + b**2) + (1 - p))
|
160
|
+
|
161
|
+
|
162
|
+
def geninvgauss_pdf(x, p, b):
|
163
|
+
m = geninvgauss_mode(p, b)
|
164
|
+
lfm = (p - 1) * math.log(m) - 0.5 * b * (m + 1 / m)
|
165
|
+
if x > 0:
|
166
|
+
return math.exp((p - 1) * math.log(x) - 0.5 * b * (x + 1 / x) - lfm)
|
167
|
+
return 0.0
|
168
|
+
|
169
|
+
|
170
|
+
def invgauss_mode(mu):
|
171
|
+
return 1.0 / (math.sqrt(1.5 * 1.5 + 1 / (mu * mu)) + 1.5)
|
172
|
+
|
173
|
+
|
174
|
+
def invgauss_pdf(x, mu):
|
175
|
+
m = invgauss_mode(mu)
|
176
|
+
lfm = -1.5 * math.log(m) - (m - mu) ** 2 / (2 * m * mu**2)
|
177
|
+
if x > 0:
|
178
|
+
return math.exp(-1.5 * math.log(x) - (x - mu) ** 2 / (2 * x * mu**2) - lfm)
|
179
|
+
return 0.0
|
180
|
+
|
181
|
+
|
182
|
+
def powerlaw_pdf(x, a):
|
183
|
+
if x > 0:
|
184
|
+
return x ** (a - 1)
|
185
|
+
return 0.0
|
186
|
+
|
187
|
+
|
188
|
+
# Define a dictionary: for a given distribution (keys), another dictionary
|
189
|
+
# (values) specifies the parameters for NumericalInversePolynomial (PINV).
|
190
|
+
# The keys of the latter dictionary are:
|
191
|
+
# - pdf: the pdf of the distribution (callable). The signature of the pdf
|
192
|
+
# is float -> float (i.e., the function does not have to be vectorized).
|
193
|
+
# If possible, functions like log or exp from the module math should be
|
194
|
+
# preferred over functions from numpy since the PINV setup will be faster
|
195
|
+
# in that case.
|
196
|
+
# - check_pinv_params: callable f that returns true if the shape parameters
|
197
|
+
# (args) are recommended parameters for PINV (i.e., the u-error does
|
198
|
+
# not exceed the default tolerance)
|
199
|
+
# - center: scalar if the center does not depend on args, otherwise
|
200
|
+
# callable that returns the center as a function of the shape parameters
|
201
|
+
# - rvs_transform: a callable that can be used to transform the rvs that
|
202
|
+
# are distributed according to the pdf to the target distribution
|
203
|
+
# (as an example, see the entry for the beta distribution)
|
204
|
+
# - rvs_transform_inv: the inverse of rvs_transform (it is required
|
205
|
+
# for the transformed ppf)
|
206
|
+
# - mirror_uniform: boolean or a callable that returns true or false
|
207
|
+
# depending on the shape parameters. If True, the ppf is applied
|
208
|
+
# to 1-u instead of u to generate rvs, where u is a uniform rv.
|
209
|
+
# While both u and 1-u are uniform, it can be required to use 1-u
|
210
|
+
# to compute the u-error correctly. This is only relevant for the argus
|
211
|
+
# distribution.
|
212
|
+
# The only required keys are "pdf" and "check_pinv_params".
|
213
|
+
# All other keys are optional.
|
214
|
+
|
215
|
+
PINV_CONFIG = {
|
216
|
+
"alpha": {
|
217
|
+
"pdf": alpha_pdf,
|
218
|
+
"check_pinv_params": lambda a: 1.0e-11 <= a < 2.1e5,
|
219
|
+
"center": lambda a: 0.25 * (math.sqrt(a * a + 8.0) - a),
|
220
|
+
},
|
221
|
+
"anglit": {
|
222
|
+
"pdf": lambda x: math.cos(2 * x) + 1.0e-13,
|
223
|
+
# +1.e-13 is necessary, otherwise PINV has strange problems as
|
224
|
+
# f(upper border) is very close to 0
|
225
|
+
"center": 0,
|
226
|
+
},
|
227
|
+
"argus": {
|
228
|
+
"pdf": argus_pdf,
|
229
|
+
"center": lambda chi: 0.7 if chi <= 5 else 0.5,
|
230
|
+
"check_pinv_params": lambda chi: 1e-20 < chi < 901,
|
231
|
+
"rvs_transform": argus_gamma_trf,
|
232
|
+
"rvs_transform_inv": argus_gamma_inv_trf,
|
233
|
+
"mirror_uniform": lambda chi: chi > 5,
|
234
|
+
},
|
235
|
+
"beta": {
|
236
|
+
"pdf": betaprime_pdf,
|
237
|
+
"center": lambda a, b: max(0.1, (a - 1) / (b + 1)),
|
238
|
+
"check_pinv_params": beta_valid_params,
|
239
|
+
"rvs_transform": lambda x, *args: x / (1 + x),
|
240
|
+
"rvs_transform_inv": lambda x, *args: x / (1 - x) if x < 1 else np.inf,
|
241
|
+
},
|
242
|
+
"betaprime": {
|
243
|
+
"pdf": betaprime_pdf,
|
244
|
+
"center": lambda a, b: max(0.1, (a - 1) / (b + 1)),
|
245
|
+
"check_pinv_params": beta_valid_params,
|
246
|
+
},
|
247
|
+
"bradford": {
|
248
|
+
"pdf": bradford_pdf,
|
249
|
+
"check_pinv_params": lambda a: 1.0e-6 <= a <= 1e9,
|
250
|
+
"center": 0.5,
|
251
|
+
},
|
252
|
+
"burr": {
|
253
|
+
"pdf": burr_pdf,
|
254
|
+
"center": lambda a, b: (2 ** (1 / b) - 1) ** (-1 / a),
|
255
|
+
"check_pinv_params": lambda a, b: (min(a, b) >= 0.3) and (max(a, b) <= 50),
|
256
|
+
},
|
257
|
+
"burr12": {
|
258
|
+
"pdf": burr12_pdf,
|
259
|
+
"center": lambda a, b: (2 ** (1 / b) - 1) ** (1 / a),
|
260
|
+
"check_pinv_params": lambda a, b: (min(a, b) >= 0.2) and (max(a, b) <= 50),
|
261
|
+
},
|
262
|
+
"cauchy": {
|
263
|
+
"pdf": lambda x: 1 / (1 + (x * x)),
|
264
|
+
"center": 0,
|
265
|
+
},
|
266
|
+
"chi": {
|
267
|
+
"pdf": chi_pdf,
|
268
|
+
"check_pinv_params": lambda df: 0.05 <= df <= 1.0e6,
|
269
|
+
"center": lambda a: math.sqrt(a),
|
270
|
+
},
|
271
|
+
"chi2": {
|
272
|
+
"pdf": chi2_pdf,
|
273
|
+
"check_pinv_params": lambda df: 0.07 <= df <= 1e6,
|
274
|
+
"center": lambda a: a,
|
275
|
+
},
|
276
|
+
"cosine": {
|
277
|
+
"pdf": lambda x: 1 + math.cos(x),
|
278
|
+
"center": 0,
|
279
|
+
},
|
280
|
+
"crystalball": {
|
281
|
+
"pdf": crystalball_pdf,
|
282
|
+
"check_pinv_params": lambda b, m: (0.01 <= b <= 5.5)
|
283
|
+
and (1.1 <= m <= 75.1),
|
284
|
+
"center": 0.0,
|
285
|
+
},
|
286
|
+
"expon": {
|
287
|
+
"pdf": lambda x: math.exp(-x),
|
288
|
+
"center": 1.0,
|
289
|
+
},
|
290
|
+
"gamma": {
|
291
|
+
"pdf": gamma_pdf,
|
292
|
+
"check_pinv_params": lambda a: 0.04 <= a <= 1e6,
|
293
|
+
"center": lambda a: a,
|
294
|
+
},
|
295
|
+
"gennorm": {
|
296
|
+
"pdf": lambda x, b: math.exp(-abs(x) ** b),
|
297
|
+
"check_pinv_params": lambda b: 0.081 <= b <= 45.0,
|
298
|
+
"center": 0.0,
|
299
|
+
},
|
300
|
+
"geninvgauss": {
|
301
|
+
"pdf": geninvgauss_pdf,
|
302
|
+
"check_pinv_params": lambda p, b: (abs(p) <= 1200.0)
|
303
|
+
and (1.0e-10 <= b <= 1200.0),
|
304
|
+
"center": geninvgauss_mode,
|
305
|
+
},
|
306
|
+
"gumbel_l": {
|
307
|
+
"pdf": lambda x: math.exp(x - math.exp(x)),
|
308
|
+
"center": -0.6,
|
309
|
+
},
|
310
|
+
"gumbel_r": {
|
311
|
+
"pdf": lambda x: math.exp(-x - math.exp(-x)),
|
312
|
+
"center": 0.6,
|
313
|
+
},
|
314
|
+
"hypsecant": {
|
315
|
+
"pdf": lambda x: 1.0 / (math.exp(x) + math.exp(-x)),
|
316
|
+
"center": 0.0,
|
317
|
+
},
|
318
|
+
"invgamma": {
|
319
|
+
"pdf": invgamma_pdf,
|
320
|
+
"check_pinv_params": lambda a: 0.04 <= a <= 1e6,
|
321
|
+
"center": lambda a: 1 / a,
|
322
|
+
},
|
323
|
+
"invgauss": {
|
324
|
+
"pdf": invgauss_pdf,
|
325
|
+
"check_pinv_params": lambda mu: 1.0e-10 <= mu <= 1.0e9,
|
326
|
+
"center": invgauss_mode,
|
327
|
+
},
|
328
|
+
"invweibull": {
|
329
|
+
"pdf": invweibull_pdf,
|
330
|
+
"check_pinv_params": lambda a: 0.12 <= a <= 512,
|
331
|
+
"center": 1.0,
|
332
|
+
},
|
333
|
+
"laplace": {
|
334
|
+
"pdf": lambda x: math.exp(-abs(x)),
|
335
|
+
"center": 0.0,
|
336
|
+
},
|
337
|
+
"logistic": {
|
338
|
+
"pdf": lambda x: math.exp(-x) / (1 + math.exp(-x)) ** 2,
|
339
|
+
"center": 0.0,
|
340
|
+
},
|
341
|
+
"maxwell": {
|
342
|
+
"pdf": lambda x: x * x * math.exp(-0.5 * x * x),
|
343
|
+
"center": 1.41421,
|
344
|
+
},
|
345
|
+
"moyal": {
|
346
|
+
"pdf": lambda x: math.exp(-(x + math.exp(-x)) / 2),
|
347
|
+
"center": 1.2,
|
348
|
+
},
|
349
|
+
"norm": {
|
350
|
+
"pdf": lambda x: math.exp(-x * x / 2),
|
351
|
+
"center": 0.0,
|
352
|
+
},
|
353
|
+
"pareto": {
|
354
|
+
"pdf": lambda x, b: x ** -(b + 1),
|
355
|
+
"center": lambda b: b / (b - 1) if b > 2 else 1.5,
|
356
|
+
"check_pinv_params": lambda b: 0.08 <= b <= 400000,
|
357
|
+
},
|
358
|
+
"powerlaw": {
|
359
|
+
"pdf": powerlaw_pdf,
|
360
|
+
"center": 1.0,
|
361
|
+
"check_pinv_params": lambda a: 0.06 <= a <= 1.0e5,
|
362
|
+
},
|
363
|
+
"t": {
|
364
|
+
"pdf": lambda x, df: (1 + x * x / df) ** (-0.5 * (df + 1)),
|
365
|
+
"check_pinv_params": lambda a: 0.07 <= a <= 1e6,
|
366
|
+
"center": 0.0,
|
367
|
+
},
|
368
|
+
"rayleigh": {
|
369
|
+
"pdf": lambda x: x * math.exp(-0.5 * (x * x)),
|
370
|
+
"center": 1.0,
|
371
|
+
},
|
372
|
+
"semicircular": {
|
373
|
+
"pdf": lambda x: math.sqrt(1.0 - (x * x)),
|
374
|
+
"center": 0,
|
375
|
+
},
|
376
|
+
"wald": {
|
377
|
+
"pdf": wald_pdf,
|
378
|
+
"center": 1.0,
|
379
|
+
},
|
380
|
+
"weibull_max": {
|
381
|
+
"pdf": weibull_max_pdf,
|
382
|
+
"check_pinv_params": lambda a: 0.25 <= a <= 512,
|
383
|
+
"center": -1.0,
|
384
|
+
},
|
385
|
+
"weibull_min": {
|
386
|
+
"pdf": weibull_min_pdf,
|
387
|
+
"check_pinv_params": lambda a: 0.25 <= a <= 512,
|
388
|
+
"center": 1.0,
|
389
|
+
},
|
390
|
+
}
|
391
|
+
|
392
|
+
|
393
|
+
def _validate_qmc_input(qmc_engine, d, seed):
|
394
|
+
# Input validation for `qmc_engine` and `d`
|
395
|
+
# Error messages for invalid `d` are raised by QMCEngine
|
396
|
+
# we could probably use a stats.qmc.check_qrandom_state
|
397
|
+
if isinstance(qmc_engine, QMCEngine):
|
398
|
+
if d is not None and qmc_engine.d != d:
|
399
|
+
message = "`d` must be consistent with dimension of `qmc_engine`."
|
400
|
+
raise ValueError(message)
|
401
|
+
d = qmc_engine.d if d is None else d
|
402
|
+
elif qmc_engine is None:
|
403
|
+
d = 1 if d is None else d
|
404
|
+
qmc_engine = Halton(d, seed=seed)
|
405
|
+
else:
|
406
|
+
message = (
|
407
|
+
"`qmc_engine` must be an instance of "
|
408
|
+
"`scipy.stats.qmc.QMCEngine` or `None`."
|
409
|
+
)
|
410
|
+
raise ValueError(message)
|
411
|
+
|
412
|
+
return qmc_engine, d
|
413
|
+
|
414
|
+
|
415
|
+
class CustomDistPINV:
|
416
|
+
def __init__(self, pdf, args):
|
417
|
+
self._pdf = lambda x: pdf(x, *args)
|
418
|
+
|
419
|
+
def pdf(self, x):
|
420
|
+
return self._pdf(x)
|
421
|
+
|
422
|
+
|
423
|
+
class FastGeneratorInversion:
|
424
|
+
"""
|
425
|
+
Fast sampling by numerical inversion of the CDF for a large class of
|
426
|
+
continuous distributions in `scipy.stats`.
|
427
|
+
|
428
|
+
Parameters
|
429
|
+
----------
|
430
|
+
dist : rv_frozen object
|
431
|
+
Frozen distribution object from `scipy.stats`. The list of supported
|
432
|
+
distributions can be found in the Notes section. The shape parameters,
|
433
|
+
`loc` and `scale` used to create the distributions must be scalars.
|
434
|
+
For example, for the Gamma distribution with shape parameter `p`,
|
435
|
+
`p` has to be a float, and for the beta distribution with shape
|
436
|
+
parameters (a, b), both a and b have to be floats.
|
437
|
+
domain : tuple of floats, optional
|
438
|
+
If one wishes to sample from a truncated/conditional distribution,
|
439
|
+
the domain has to be specified.
|
440
|
+
The default is None. In that case, the random variates are not
|
441
|
+
truncated, and the domain is inferred from the support of the
|
442
|
+
distribution.
|
443
|
+
ignore_shape_range : boolean, optional.
|
444
|
+
If False, shape parameters that are outside of the valid range
|
445
|
+
of values to ensure that the numerical accuracy (see Notes) is
|
446
|
+
high, raise a ValueError. If True, any shape parameters that are valid
|
447
|
+
for the distribution are accepted. This can be useful for testing.
|
448
|
+
The default is False.
|
449
|
+
random_state : {None, int, `numpy.random.Generator`,
|
450
|
+
`numpy.random.RandomState`}, optional
|
451
|
+
|
452
|
+
A NumPy random number generator or seed for the underlying NumPy
|
453
|
+
random number generator used to generate the stream of uniform
|
454
|
+
random numbers.
|
455
|
+
If `random_state` is None, it uses ``self.random_state``.
|
456
|
+
If `random_state` is an int,
|
457
|
+
``np.random.default_rng(random_state)`` is used.
|
458
|
+
If `random_state` is already a ``Generator`` or ``RandomState``
|
459
|
+
instance then that instance is used.
|
460
|
+
|
461
|
+
Attributes
|
462
|
+
----------
|
463
|
+
loc : float
|
464
|
+
The location parameter.
|
465
|
+
random_state : {`numpy.random.Generator`, `numpy.random.RandomState`}
|
466
|
+
The random state used in relevant methods like `rvs` (unless
|
467
|
+
another `random_state` is passed as an argument to these methods).
|
468
|
+
scale : float
|
469
|
+
The scale parameter.
|
470
|
+
|
471
|
+
Methods
|
472
|
+
-------
|
473
|
+
cdf
|
474
|
+
evaluate_error
|
475
|
+
ppf
|
476
|
+
qrvs
|
477
|
+
rvs
|
478
|
+
support
|
479
|
+
|
480
|
+
Notes
|
481
|
+
-----
|
482
|
+
The class creates an object for continuous distributions specified
|
483
|
+
by `dist`. The method `rvs` uses a generator from
|
484
|
+
`scipy.stats.sampling` that is created when the object is instantiated.
|
485
|
+
In addition, the methods `qrvs` and `ppf` are added.
|
486
|
+
`qrvs` generate samples based on quasi-random numbers from
|
487
|
+
`scipy.stats.qmc`. `ppf` is the PPF based on the
|
488
|
+
numerical inversion method in [1]_ (`NumericalInversePolynomial`) that is
|
489
|
+
used to generate random variates.
|
490
|
+
|
491
|
+
Supported distributions (`distname`) are:
|
492
|
+
``alpha``, ``anglit``, ``argus``, ``beta``, ``betaprime``, ``bradford``,
|
493
|
+
``burr``, ``burr12``, ``cauchy``, ``chi``, ``chi2``, ``cosine``,
|
494
|
+
``crystalball``, ``expon``, ``gamma``, ``gennorm``, ``geninvgauss``,
|
495
|
+
``gumbel_l``, ``gumbel_r``, ``hypsecant``, ``invgamma``, ``invgauss``,
|
496
|
+
``invweibull``, ``laplace``, ``logistic``, ``maxwell``, ``moyal``,
|
497
|
+
``norm``, ``pareto``, ``powerlaw``, ``t``, ``rayleigh``, ``semicircular``,
|
498
|
+
``wald``, ``weibull_max``, ``weibull_min``.
|
499
|
+
|
500
|
+
`rvs` relies on the accuracy of the numerical inversion. If very extreme
|
501
|
+
shape parameters are used, the numerical inversion might not work. However,
|
502
|
+
for all implemented distributions, the admissible shape parameters have
|
503
|
+
been tested, and an error will be raised if the user supplies values
|
504
|
+
outside of the allowed range. The u-error should not exceed 1e-10 for all
|
505
|
+
valid parameters. Note that warnings might be raised even if parameters
|
506
|
+
are within the valid range when the object is instantiated.
|
507
|
+
To check numerical accuracy, the method `evaluate_error` can be used.
|
508
|
+
|
509
|
+
Note that all implemented distributions are also part of `scipy.stats`, and
|
510
|
+
the object created by `FastGeneratorInversion` relies on methods like
|
511
|
+
`ppf`, `cdf` and `pdf` from `rv_frozen`. The main benefit of using this
|
512
|
+
class can be summarized as follows: Once the generator to sample random
|
513
|
+
variates is created in the setup step, sampling and evaluation of
|
514
|
+
the PPF using `ppf` are very fast,
|
515
|
+
and performance is essentially independent of the distribution. Therefore,
|
516
|
+
a substantial speed-up can be achieved for many distributions if large
|
517
|
+
numbers of random variates are required. It is important to know that this
|
518
|
+
fast sampling is achieved by inversion of the CDF. Thus, one uniform
|
519
|
+
random variate is transformed into a non-uniform variate, which is an
|
520
|
+
advantage for several simulation methods, e.g., when
|
521
|
+
the variance reduction methods of common random variates or
|
522
|
+
antithetic variates are be used ([2]_).
|
523
|
+
|
524
|
+
In addition, inversion makes it possible to
|
525
|
+
- to use a QMC generator from `scipy.stats.qmc` (method `qrvs`),
|
526
|
+
- to generate random variates truncated to an interval. For example, if
|
527
|
+
one aims to sample standard normal random variates from
|
528
|
+
the interval (2, 4), this can be easily achieved by using the parameter
|
529
|
+
`domain`.
|
530
|
+
|
531
|
+
The location and scale that are initially defined by `dist`
|
532
|
+
can be reset without having to rerun the setup
|
533
|
+
step to create the generator that is used for sampling. The relation
|
534
|
+
of the distribution `Y` with `loc` and `scale` to the standard
|
535
|
+
distribution `X` (i.e., ``loc=0`` and ``scale=1``) is given by
|
536
|
+
``Y = loc + scale * X``.
|
537
|
+
|
538
|
+
References
|
539
|
+
----------
|
540
|
+
.. [1] Derflinger, Gerhard, Wolfgang Hörmann, and Josef Leydold.
|
541
|
+
"Random variate generation by numerical inversion when only the
|
542
|
+
density is known." ACM Transactions on Modeling and Computer
|
543
|
+
Simulation (TOMACS) 20.4 (2010): 1-25.
|
544
|
+
.. [2] Hörmann, Wolfgang, Josef Leydold and Gerhard Derflinger.
|
545
|
+
"Automatic nonuniform random number generation."
|
546
|
+
Springer, 2004.
|
547
|
+
|
548
|
+
Examples
|
549
|
+
--------
|
550
|
+
>>> import numpy as np
|
551
|
+
>>> from scipy import stats
|
552
|
+
>>> from scipy.stats.sampling import FastGeneratorInversion
|
553
|
+
|
554
|
+
Let's start with a simple example to illustrate the main features:
|
555
|
+
|
556
|
+
>>> gamma_frozen = stats.gamma(1.5)
|
557
|
+
>>> gamma_dist = FastGeneratorInversion(gamma_frozen)
|
558
|
+
>>> r = gamma_dist.rvs(size=1000)
|
559
|
+
|
560
|
+
The mean should be approximately equal to the shape parameter 1.5:
|
561
|
+
|
562
|
+
>>> r.mean()
|
563
|
+
1.52423591130436 # may vary
|
564
|
+
|
565
|
+
Similarly, we can draw a sample based on quasi-random numbers:
|
566
|
+
|
567
|
+
>>> r = gamma_dist.qrvs(size=1000)
|
568
|
+
>>> r.mean()
|
569
|
+
1.4996639255942914 # may vary
|
570
|
+
|
571
|
+
Compare the PPF against approximation `ppf`.
|
572
|
+
|
573
|
+
>>> q = [0.001, 0.2, 0.5, 0.8, 0.999]
|
574
|
+
>>> np.max(np.abs(gamma_frozen.ppf(q) - gamma_dist.ppf(q)))
|
575
|
+
4.313394796895409e-08
|
576
|
+
|
577
|
+
To confirm that the numerical inversion is accurate, we evaluate the
|
578
|
+
approximation error (u-error), which should be below 1e-10 (for more
|
579
|
+
details, refer to the documentation of `evaluate_error`):
|
580
|
+
|
581
|
+
>>> gamma_dist.evaluate_error()
|
582
|
+
(7.446320551265581e-11, nan) # may vary
|
583
|
+
|
584
|
+
Note that the location and scale can be changed without instantiating a
|
585
|
+
new generator:
|
586
|
+
|
587
|
+
>>> gamma_dist.loc = 2
|
588
|
+
>>> gamma_dist.scale = 3
|
589
|
+
>>> r = gamma_dist.rvs(size=1000)
|
590
|
+
|
591
|
+
The mean should be approximately 2 + 3*1.5 = 6.5.
|
592
|
+
|
593
|
+
>>> r.mean()
|
594
|
+
6.399549295242894 # may vary
|
595
|
+
|
596
|
+
Let us also illustrate how truncation can be applied:
|
597
|
+
|
598
|
+
>>> trunc_norm = FastGeneratorInversion(stats.norm(), domain=(3, 4))
|
599
|
+
>>> r = trunc_norm.rvs(size=1000)
|
600
|
+
>>> 3 < r.min() < r.max() < 4
|
601
|
+
True
|
602
|
+
|
603
|
+
Check the mean:
|
604
|
+
|
605
|
+
>>> r.mean()
|
606
|
+
3.250433367078603 # may vary
|
607
|
+
|
608
|
+
>>> stats.norm.expect(lb=3, ub=4, conditional=True)
|
609
|
+
3.260454285589997
|
610
|
+
|
611
|
+
In this particular, case, `scipy.stats.truncnorm` could also be used to
|
612
|
+
generate truncated normal random variates.
|
613
|
+
|
614
|
+
"""
|
615
|
+
|
616
|
+
def __init__(
|
617
|
+
self,
|
618
|
+
dist,
|
619
|
+
*,
|
620
|
+
domain=None,
|
621
|
+
ignore_shape_range=False,
|
622
|
+
random_state=None,
|
623
|
+
):
|
624
|
+
|
625
|
+
if isinstance(dist, stats.distributions.rv_frozen):
|
626
|
+
distname = dist.dist.name
|
627
|
+
if distname not in PINV_CONFIG.keys():
|
628
|
+
raise ValueError(
|
629
|
+
f"Distribution '{distname}' is not supported."
|
630
|
+
f"It must be one of {list(PINV_CONFIG.keys())}"
|
631
|
+
)
|
632
|
+
else:
|
633
|
+
raise ValueError("`dist` must be a frozen distribution object")
|
634
|
+
|
635
|
+
loc = dist.kwds.get("loc", 0)
|
636
|
+
scale = dist.kwds.get("scale", 1)
|
637
|
+
args = dist.args
|
638
|
+
if not np.isscalar(loc):
|
639
|
+
raise ValueError("loc must be scalar.")
|
640
|
+
if not np.isscalar(scale):
|
641
|
+
raise ValueError("scale must be scalar.")
|
642
|
+
|
643
|
+
self._frozendist = getattr(stats, distname)(
|
644
|
+
*args,
|
645
|
+
loc=loc,
|
646
|
+
scale=scale,
|
647
|
+
)
|
648
|
+
self._distname = distname
|
649
|
+
|
650
|
+
nargs = np.broadcast_arrays(args)[0].size
|
651
|
+
nargs_expected = self._frozendist.dist.numargs
|
652
|
+
if nargs != nargs_expected:
|
653
|
+
raise ValueError(
|
654
|
+
f"Each of the {nargs_expected} shape parameters must be a "
|
655
|
+
f"scalar, but {nargs} values are provided."
|
656
|
+
)
|
657
|
+
|
658
|
+
self.random_state = random_state
|
659
|
+
|
660
|
+
if domain is None:
|
661
|
+
self._domain = self._frozendist.support()
|
662
|
+
self._p_lower = 0.0
|
663
|
+
self._p_domain = 1.0
|
664
|
+
else:
|
665
|
+
self._domain = domain
|
666
|
+
self._p_lower = self._frozendist.cdf(self._domain[0])
|
667
|
+
_p_domain = self._frozendist.cdf(self._domain[1]) - self._p_lower
|
668
|
+
self._p_domain = _p_domain
|
669
|
+
self._set_domain_adj()
|
670
|
+
self._ignore_shape_range = ignore_shape_range
|
671
|
+
|
672
|
+
# the domain to be passed to NumericalInversePolynomial
|
673
|
+
# define a separate variable since in case of a transformation,
|
674
|
+
# domain_pinv will not be the same as self._domain
|
675
|
+
self._domain_pinv = self._domain
|
676
|
+
|
677
|
+
# get information about the distribution from the config to set up
|
678
|
+
# the generator
|
679
|
+
dist = self._process_config(distname, args)
|
680
|
+
|
681
|
+
if self._rvs_transform_inv is not None:
|
682
|
+
d0 = self._rvs_transform_inv(self._domain[0], *args)
|
683
|
+
d1 = self._rvs_transform_inv(self._domain[1], *args)
|
684
|
+
if d0 > d1:
|
685
|
+
# swap values if transformation if decreasing
|
686
|
+
d0, d1 = d1, d0
|
687
|
+
# only update _domain_pinv and not _domain
|
688
|
+
# _domain refers to the original distribution, _domain_pinv
|
689
|
+
# to the transformed distribution
|
690
|
+
self._domain_pinv = d0, d1
|
691
|
+
|
692
|
+
# self._center has been set by the call self._process_config
|
693
|
+
# check if self._center is inside the transformed domain
|
694
|
+
# _domain_pinv, otherwise move it to the endpoint that is closer
|
695
|
+
if self._center is not None:
|
696
|
+
if self._center < self._domain_pinv[0]:
|
697
|
+
self._center = self._domain_pinv[0]
|
698
|
+
elif self._center > self._domain_pinv[1]:
|
699
|
+
self._center = self._domain_pinv[1]
|
700
|
+
|
701
|
+
self._rng = NumericalInversePolynomial(
|
702
|
+
dist,
|
703
|
+
random_state=self.random_state,
|
704
|
+
domain=self._domain_pinv,
|
705
|
+
center=self._center,
|
706
|
+
)
|
707
|
+
|
708
|
+
@property
|
709
|
+
def random_state(self):
|
710
|
+
return self._random_state
|
711
|
+
|
712
|
+
@random_state.setter
|
713
|
+
def random_state(self, random_state):
|
714
|
+
self._random_state = check_random_state_qmc(random_state)
|
715
|
+
|
716
|
+
@property
|
717
|
+
def loc(self):
|
718
|
+
return self._frozendist.kwds.get("loc", 0)
|
719
|
+
|
720
|
+
@loc.setter
|
721
|
+
def loc(self, loc):
|
722
|
+
if not np.isscalar(loc):
|
723
|
+
raise ValueError("loc must be scalar.")
|
724
|
+
self._frozendist.kwds["loc"] = loc
|
725
|
+
# update the adjusted domain that depends on loc and scale
|
726
|
+
self._set_domain_adj()
|
727
|
+
|
728
|
+
@property
|
729
|
+
def scale(self):
|
730
|
+
return self._frozendist.kwds.get("scale", 0)
|
731
|
+
|
732
|
+
@scale.setter
|
733
|
+
def scale(self, scale):
|
734
|
+
if not np.isscalar(scale):
|
735
|
+
raise ValueError("scale must be scalar.")
|
736
|
+
self._frozendist.kwds["scale"] = scale
|
737
|
+
# update the adjusted domain that depends on loc and scale
|
738
|
+
self._set_domain_adj()
|
739
|
+
|
740
|
+
def _set_domain_adj(self):
|
741
|
+
""" Adjust the domain based on loc and scale. """
|
742
|
+
loc = self.loc
|
743
|
+
scale = self.scale
|
744
|
+
lb = self._domain[0] * scale + loc
|
745
|
+
ub = self._domain[1] * scale + loc
|
746
|
+
self._domain_adj = (lb, ub)
|
747
|
+
|
748
|
+
def _process_config(self, distname, args):
|
749
|
+
cfg = PINV_CONFIG[distname]
|
750
|
+
if "check_pinv_params" in cfg:
|
751
|
+
if not self._ignore_shape_range:
|
752
|
+
if not cfg["check_pinv_params"](*args):
|
753
|
+
msg = ("No generator is defined for the shape parameters "
|
754
|
+
f"{args}. Use ignore_shape_range to proceed "
|
755
|
+
"with the selected values.")
|
756
|
+
raise ValueError(msg)
|
757
|
+
|
758
|
+
if "center" in cfg.keys():
|
759
|
+
if not np.isscalar(cfg["center"]):
|
760
|
+
self._center = cfg["center"](*args)
|
761
|
+
else:
|
762
|
+
self._center = cfg["center"]
|
763
|
+
else:
|
764
|
+
self._center = None
|
765
|
+
self._rvs_transform = cfg.get("rvs_transform", None)
|
766
|
+
self._rvs_transform_inv = cfg.get("rvs_transform_inv", None)
|
767
|
+
_mirror_uniform = cfg.get("mirror_uniform", None)
|
768
|
+
if _mirror_uniform is None:
|
769
|
+
self._mirror_uniform = False
|
770
|
+
else:
|
771
|
+
self._mirror_uniform = _mirror_uniform(*args)
|
772
|
+
|
773
|
+
return CustomDistPINV(cfg["pdf"], args)
|
774
|
+
|
775
|
+
def rvs(self, size=None):
|
776
|
+
"""
|
777
|
+
Sample from the distribution by inversion.
|
778
|
+
|
779
|
+
Parameters
|
780
|
+
----------
|
781
|
+
size : int or tuple, optional
|
782
|
+
The shape of samples. Default is ``None`` in which case a scalar
|
783
|
+
sample is returned.
|
784
|
+
|
785
|
+
Returns
|
786
|
+
-------
|
787
|
+
rvs : array_like
|
788
|
+
A NumPy array of random variates.
|
789
|
+
|
790
|
+
Notes
|
791
|
+
-----
|
792
|
+
Random variates are generated by numerical inversion of the CDF, i.e.,
|
793
|
+
`ppf` computed by `NumericalInversePolynomial` when the class
|
794
|
+
is instantiated. Note that the
|
795
|
+
default ``rvs`` method of the rv_continuous class is
|
796
|
+
overwritten. Hence, a different stream of random numbers is generated
|
797
|
+
even if the same seed is used.
|
798
|
+
"""
|
799
|
+
# note: we cannot use self._rng.rvs directly in case
|
800
|
+
# self._mirror_uniform is true
|
801
|
+
u = self.random_state.uniform(size=size)
|
802
|
+
if self._mirror_uniform:
|
803
|
+
u = 1 - u
|
804
|
+
r = self._rng.ppf(u)
|
805
|
+
if self._rvs_transform is not None:
|
806
|
+
r = self._rvs_transform(r, *self._frozendist.args)
|
807
|
+
return self.loc + self.scale * r
|
808
|
+
|
809
|
+
def ppf(self, q):
|
810
|
+
"""
|
811
|
+
Very fast PPF (inverse CDF) of the distribution which
|
812
|
+
is a very close approximation of the exact PPF values.
|
813
|
+
|
814
|
+
Parameters
|
815
|
+
----------
|
816
|
+
u : array_like
|
817
|
+
Array with probabilities.
|
818
|
+
|
819
|
+
Returns
|
820
|
+
-------
|
821
|
+
ppf : array_like
|
822
|
+
Quantiles corresponding to the values in `u`.
|
823
|
+
|
824
|
+
Notes
|
825
|
+
-----
|
826
|
+
The evaluation of the PPF is very fast but it may have a large
|
827
|
+
relative error in the far tails. The numerical precision of the PPF
|
828
|
+
is controlled by the u-error, that is,
|
829
|
+
``max |u - CDF(PPF(u))|`` where the max is taken over points in
|
830
|
+
the interval [0,1], see `evaluate_error`.
|
831
|
+
|
832
|
+
Note that this PPF is designed to generate random samples.
|
833
|
+
"""
|
834
|
+
q = np.asarray(q)
|
835
|
+
if self._mirror_uniform:
|
836
|
+
x = self._rng.ppf(1 - q)
|
837
|
+
else:
|
838
|
+
x = self._rng.ppf(q)
|
839
|
+
if self._rvs_transform is not None:
|
840
|
+
x = self._rvs_transform(x, *self._frozendist.args)
|
841
|
+
return self.scale * x + self.loc
|
842
|
+
|
843
|
+
def qrvs(self, size=None, d=None, qmc_engine=None):
|
844
|
+
"""
|
845
|
+
Quasi-random variates of the given distribution.
|
846
|
+
|
847
|
+
The `qmc_engine` is used to draw uniform quasi-random variates, and
|
848
|
+
these are converted to quasi-random variates of the given distribution
|
849
|
+
using inverse transform sampling.
|
850
|
+
|
851
|
+
Parameters
|
852
|
+
----------
|
853
|
+
size : int, tuple of ints, or None; optional
|
854
|
+
Defines shape of random variates array. Default is ``None``.
|
855
|
+
d : int or None, optional
|
856
|
+
Defines dimension of uniform quasi-random variates to be
|
857
|
+
transformed. Default is ``None``.
|
858
|
+
qmc_engine : scipy.stats.qmc.QMCEngine(d=1), optional
|
859
|
+
Defines the object to use for drawing
|
860
|
+
quasi-random variates. Default is ``None``, which uses
|
861
|
+
`scipy.stats.qmc.Halton(1)`.
|
862
|
+
|
863
|
+
Returns
|
864
|
+
-------
|
865
|
+
rvs : ndarray or scalar
|
866
|
+
Quasi-random variates. See Notes for shape information.
|
867
|
+
|
868
|
+
Notes
|
869
|
+
-----
|
870
|
+
The shape of the output array depends on `size`, `d`, and `qmc_engine`.
|
871
|
+
The intent is for the interface to be natural, but the detailed rules
|
872
|
+
to achieve this are complicated.
|
873
|
+
|
874
|
+
- If `qmc_engine` is ``None``, a `scipy.stats.qmc.Halton` instance is
|
875
|
+
created with dimension `d`. If `d` is not provided, ``d=1``.
|
876
|
+
- If `qmc_engine` is not ``None`` and `d` is ``None``, `d` is
|
877
|
+
determined from the dimension of the `qmc_engine`.
|
878
|
+
- If `qmc_engine` is not ``None`` and `d` is not ``None`` but the
|
879
|
+
dimensions are inconsistent, a ``ValueError`` is raised.
|
880
|
+
- After `d` is determined according to the rules above, the output
|
881
|
+
shape is ``tuple_shape + d_shape``, where:
|
882
|
+
|
883
|
+
- ``tuple_shape = tuple()`` if `size` is ``None``,
|
884
|
+
- ``tuple_shape = (size,)`` if `size` is an ``int``,
|
885
|
+
- ``tuple_shape = size`` if `size` is a sequence,
|
886
|
+
- ``d_shape = tuple()`` if `d` is ``None`` or `d` is 1, and
|
887
|
+
- ``d_shape = (d,)`` if `d` is greater than 1.
|
888
|
+
|
889
|
+
The elements of the returned array are part of a low-discrepancy
|
890
|
+
sequence. If `d` is 1, this means that none of the samples are truly
|
891
|
+
independent. If `d` > 1, each slice ``rvs[..., i]`` will be of a
|
892
|
+
quasi-independent sequence; see `scipy.stats.qmc.QMCEngine` for
|
893
|
+
details. Note that when `d` > 1, the samples returned are still those
|
894
|
+
of the provided univariate distribution, not a multivariate
|
895
|
+
generalization of that distribution.
|
896
|
+
|
897
|
+
"""
|
898
|
+
qmc_engine, d = _validate_qmc_input(qmc_engine, d, self.random_state)
|
899
|
+
# mainly copied from unuran_wrapper.pyx.templ
|
900
|
+
# `rvs` is flexible about whether `size` is an int or tuple, so this
|
901
|
+
# should be, too.
|
902
|
+
try:
|
903
|
+
if size is None:
|
904
|
+
tuple_size = (1,)
|
905
|
+
else:
|
906
|
+
tuple_size = tuple(size)
|
907
|
+
except TypeError:
|
908
|
+
tuple_size = (size,)
|
909
|
+
# we do not use rng.qrvs directly since we need to be
|
910
|
+
# able to apply the ppf to 1 - u
|
911
|
+
N = 1 if size is None else np.prod(size)
|
912
|
+
u = qmc_engine.random(N)
|
913
|
+
if self._mirror_uniform:
|
914
|
+
u = 1 - u
|
915
|
+
qrvs = self._ppf(u)
|
916
|
+
if self._rvs_transform is not None:
|
917
|
+
qrvs = self._rvs_transform(qrvs, *self._frozendist.args)
|
918
|
+
if size is None:
|
919
|
+
qrvs = qrvs.squeeze()[()]
|
920
|
+
else:
|
921
|
+
if d == 1:
|
922
|
+
qrvs = qrvs.reshape(tuple_size)
|
923
|
+
else:
|
924
|
+
qrvs = qrvs.reshape(tuple_size + (d,))
|
925
|
+
return self.loc + self.scale * qrvs
|
926
|
+
|
927
|
+
def evaluate_error(self, size=100000, random_state=None, x_error=False):
|
928
|
+
"""
|
929
|
+
Evaluate the numerical accuracy of the inversion (u- and x-error).
|
930
|
+
|
931
|
+
Parameters
|
932
|
+
----------
|
933
|
+
size : int, optional
|
934
|
+
The number of random points over which the error is estimated.
|
935
|
+
Default is ``100000``.
|
936
|
+
random_state : {None, int, `numpy.random.Generator`,
|
937
|
+
`numpy.random.RandomState`}, optional
|
938
|
+
|
939
|
+
A NumPy random number generator or seed for the underlying NumPy
|
940
|
+
random number generator used to generate the stream of uniform
|
941
|
+
random numbers.
|
942
|
+
If `random_state` is None, use ``self.random_state``.
|
943
|
+
If `random_state` is an int,
|
944
|
+
``np.random.default_rng(random_state)`` is used.
|
945
|
+
If `random_state` is already a ``Generator`` or ``RandomState``
|
946
|
+
instance then that instance is used.
|
947
|
+
|
948
|
+
Returns
|
949
|
+
-------
|
950
|
+
u_error, x_error : tuple of floats
|
951
|
+
A NumPy array of random variates.
|
952
|
+
|
953
|
+
Notes
|
954
|
+
-----
|
955
|
+
The numerical precision of the inverse CDF `ppf` is controlled by
|
956
|
+
the u-error. It is computed as follows:
|
957
|
+
``max |u - CDF(PPF(u))|`` where the max is taken `size` random
|
958
|
+
points in the interval [0,1]. `random_state` determines the random
|
959
|
+
sample. Note that if `ppf` was exact, the u-error would be zero.
|
960
|
+
|
961
|
+
The x-error measures the direct distance between the exact PPF
|
962
|
+
and `ppf`. If ``x_error`` is set to ``True`, it is
|
963
|
+
computed as the maximum of the minimum of the relative and absolute
|
964
|
+
x-error:
|
965
|
+
``max(min(x_error_abs[i], x_error_rel[i]))`` where
|
966
|
+
``x_error_abs[i] = |PPF(u[i]) - PPF_fast(u[i])|``,
|
967
|
+
``x_error_rel[i] = max |(PPF(u[i]) - PPF_fast(u[i])) / PPF(u[i])|``.
|
968
|
+
Note that it is important to consider the relative x-error in the case
|
969
|
+
that ``PPF(u)`` is close to zero or very large.
|
970
|
+
|
971
|
+
By default, only the u-error is evaluated and the x-error is set to
|
972
|
+
``np.nan``. Note that the evaluation of the x-error will be very slow
|
973
|
+
if the implementation of the PPF is slow.
|
974
|
+
|
975
|
+
Further information about these error measures can be found in [1]_.
|
976
|
+
|
977
|
+
References
|
978
|
+
----------
|
979
|
+
.. [1] Derflinger, Gerhard, Wolfgang Hörmann, and Josef Leydold.
|
980
|
+
"Random variate generation by numerical inversion when only the
|
981
|
+
density is known." ACM Transactions on Modeling and Computer
|
982
|
+
Simulation (TOMACS) 20.4 (2010): 1-25.
|
983
|
+
|
984
|
+
Examples
|
985
|
+
--------
|
986
|
+
|
987
|
+
>>> import numpy as np
|
988
|
+
>>> from scipy import stats
|
989
|
+
>>> from scipy.stats.sampling import FastGeneratorInversion
|
990
|
+
|
991
|
+
Create an object for the normal distribution:
|
992
|
+
|
993
|
+
>>> d_norm_frozen = stats.norm()
|
994
|
+
>>> d_norm = FastGeneratorInversion(d_norm_frozen)
|
995
|
+
|
996
|
+
To confirm that the numerical inversion is accurate, we evaluate the
|
997
|
+
approximation error (u-error and x-error).
|
998
|
+
|
999
|
+
>>> u_error, x_error = d_norm.evaluate_error(x_error=True)
|
1000
|
+
|
1001
|
+
The u-error should be below 1e-10:
|
1002
|
+
|
1003
|
+
>>> u_error
|
1004
|
+
8.785783212061915e-11 # may vary
|
1005
|
+
|
1006
|
+
Compare the PPF against approximation `ppf`:
|
1007
|
+
|
1008
|
+
>>> q = [0.001, 0.2, 0.4, 0.6, 0.8, 0.999]
|
1009
|
+
>>> diff = np.abs(d_norm_frozen.ppf(q) - d_norm.ppf(q))
|
1010
|
+
>>> x_error_abs = np.max(diff)
|
1011
|
+
>>> x_error_abs
|
1012
|
+
1.2937954707581412e-08
|
1013
|
+
|
1014
|
+
This is the absolute x-error evaluated at the points q. The relative
|
1015
|
+
error is given by
|
1016
|
+
|
1017
|
+
>>> x_error_rel = np.max(diff / np.abs(d_norm_frozen.ppf(q)))
|
1018
|
+
>>> x_error_rel
|
1019
|
+
4.186725600453555e-09
|
1020
|
+
|
1021
|
+
The x_error computed above is derived in a very similar way over a
|
1022
|
+
much larger set of random values q. At each value q[i], the minimum
|
1023
|
+
of the relative and absolute error is taken. The final value is then
|
1024
|
+
derived as the maximum of these values. In our example, we get the
|
1025
|
+
following value:
|
1026
|
+
|
1027
|
+
>>> x_error
|
1028
|
+
4.507068014335139e-07 # may vary
|
1029
|
+
|
1030
|
+
"""
|
1031
|
+
if not isinstance(size, numbers.Integral | np.integer):
|
1032
|
+
raise ValueError("size must be an integer.")
|
1033
|
+
# urng will be used to draw the samples for testing the error
|
1034
|
+
# it must not interfere with self.random_state. therefore, do not
|
1035
|
+
# call self.rvs, but draw uniform random numbers and apply
|
1036
|
+
# self.ppf (note: like in rvs, consider self._mirror_uniform)
|
1037
|
+
urng = check_random_state_qmc(random_state)
|
1038
|
+
u = urng.uniform(size=size)
|
1039
|
+
if self._mirror_uniform:
|
1040
|
+
u = 1 - u
|
1041
|
+
x = self.ppf(u)
|
1042
|
+
uerr = np.max(np.abs(self._cdf(x) - u))
|
1043
|
+
if not x_error:
|
1044
|
+
return uerr, np.nan
|
1045
|
+
ppf_u = self._ppf(u)
|
1046
|
+
x_error_abs = np.abs(self.ppf(u)-ppf_u)
|
1047
|
+
x_error_rel = x_error_abs / np.abs(ppf_u)
|
1048
|
+
x_error_combined = np.array([x_error_abs, x_error_rel]).min(axis=0)
|
1049
|
+
return uerr, np.max(x_error_combined)
|
1050
|
+
|
1051
|
+
def support(self):
|
1052
|
+
"""Support of the distribution.
|
1053
|
+
|
1054
|
+
Returns
|
1055
|
+
-------
|
1056
|
+
a, b : float
|
1057
|
+
end-points of the distribution's support.
|
1058
|
+
|
1059
|
+
Notes
|
1060
|
+
-----
|
1061
|
+
|
1062
|
+
Note that the support of the distribution depends on `loc`,
|
1063
|
+
`scale` and `domain`.
|
1064
|
+
|
1065
|
+
Examples
|
1066
|
+
--------
|
1067
|
+
|
1068
|
+
>>> from scipy import stats
|
1069
|
+
>>> from scipy.stats.sampling import FastGeneratorInversion
|
1070
|
+
|
1071
|
+
Define a truncated normal distribution:
|
1072
|
+
|
1073
|
+
>>> d_norm = FastGeneratorInversion(stats.norm(), domain=(0, 1))
|
1074
|
+
>>> d_norm.support()
|
1075
|
+
(0, 1)
|
1076
|
+
|
1077
|
+
Shift the distribution:
|
1078
|
+
|
1079
|
+
>>> d_norm.loc = 2.5
|
1080
|
+
>>> d_norm.support()
|
1081
|
+
(2.5, 3.5)
|
1082
|
+
|
1083
|
+
"""
|
1084
|
+
return self._domain_adj
|
1085
|
+
|
1086
|
+
def _cdf(self, x):
|
1087
|
+
"""Cumulative distribution function (CDF)
|
1088
|
+
|
1089
|
+
Parameters
|
1090
|
+
----------
|
1091
|
+
x : array_like
|
1092
|
+
The values where the CDF is evaluated
|
1093
|
+
|
1094
|
+
Returns
|
1095
|
+
-------
|
1096
|
+
y : ndarray
|
1097
|
+
CDF evaluated at x
|
1098
|
+
|
1099
|
+
"""
|
1100
|
+
y = self._frozendist.cdf(x)
|
1101
|
+
if self._p_domain == 1.0:
|
1102
|
+
return y
|
1103
|
+
return np.clip((y - self._p_lower) / self._p_domain, 0, 1)
|
1104
|
+
|
1105
|
+
def _ppf(self, q):
|
1106
|
+
"""Percent point function (inverse of `cdf`)
|
1107
|
+
|
1108
|
+
Parameters
|
1109
|
+
----------
|
1110
|
+
q : array_like
|
1111
|
+
lower tail probability
|
1112
|
+
|
1113
|
+
Returns
|
1114
|
+
-------
|
1115
|
+
x : array_like
|
1116
|
+
quantile corresponding to the lower tail probability q.
|
1117
|
+
|
1118
|
+
"""
|
1119
|
+
if self._p_domain == 1.0:
|
1120
|
+
return self._frozendist.ppf(q)
|
1121
|
+
x = self._frozendist.ppf(self._p_domain * np.array(q) + self._p_lower)
|
1122
|
+
return np.clip(x, self._domain_adj[0], self._domain_adj[1])
|
1123
|
+
|
1124
|
+
|
1125
|
+
class RatioUniforms:
|
1126
|
+
"""
|
1127
|
+
Generate random samples from a probability density function using the
|
1128
|
+
ratio-of-uniforms method.
|
1129
|
+
|
1130
|
+
Parameters
|
1131
|
+
----------
|
1132
|
+
pdf : callable
|
1133
|
+
A function with signature `pdf(x)` that is proportional to the
|
1134
|
+
probability density function of the distribution.
|
1135
|
+
umax : float
|
1136
|
+
The upper bound of the bounding rectangle in the u-direction.
|
1137
|
+
vmin : float
|
1138
|
+
The lower bound of the bounding rectangle in the v-direction.
|
1139
|
+
vmax : float
|
1140
|
+
The upper bound of the bounding rectangle in the v-direction.
|
1141
|
+
c : float, optional.
|
1142
|
+
Shift parameter of ratio-of-uniforms method, see Notes. Default is 0.
|
1143
|
+
random_state : {None, int, `numpy.random.Generator`,
|
1144
|
+
`numpy.random.RandomState`}, optional
|
1145
|
+
|
1146
|
+
If `seed` is None (or `np.random`), the `numpy.random.RandomState`
|
1147
|
+
singleton is used.
|
1148
|
+
If `seed` is an int, a new ``RandomState`` instance is used,
|
1149
|
+
seeded with `seed`.
|
1150
|
+
If `seed` is already a ``Generator`` or ``RandomState`` instance then
|
1151
|
+
that instance is used.
|
1152
|
+
|
1153
|
+
Methods
|
1154
|
+
-------
|
1155
|
+
rvs
|
1156
|
+
|
1157
|
+
Notes
|
1158
|
+
-----
|
1159
|
+
Given a univariate probability density function `pdf` and a constant `c`,
|
1160
|
+
define the set ``A = {(u, v) : 0 < u <= sqrt(pdf(v/u + c))}``.
|
1161
|
+
If ``(U, V)`` is a random vector uniformly distributed over ``A``,
|
1162
|
+
then ``V/U + c`` follows a distribution according to `pdf`.
|
1163
|
+
|
1164
|
+
The above result (see [1]_, [2]_) can be used to sample random variables
|
1165
|
+
using only the PDF, i.e. no inversion of the CDF is required. Typical
|
1166
|
+
choices of `c` are zero or the mode of `pdf`. The set ``A`` is a subset of
|
1167
|
+
the rectangle ``R = [0, umax] x [vmin, vmax]`` where
|
1168
|
+
|
1169
|
+
- ``umax = sup sqrt(pdf(x))``
|
1170
|
+
- ``vmin = inf (x - c) sqrt(pdf(x))``
|
1171
|
+
- ``vmax = sup (x - c) sqrt(pdf(x))``
|
1172
|
+
|
1173
|
+
In particular, these values are finite if `pdf` is bounded and
|
1174
|
+
``x**2 * pdf(x)`` is bounded (i.e. subquadratic tails).
|
1175
|
+
One can generate ``(U, V)`` uniformly on ``R`` and return
|
1176
|
+
``V/U + c`` if ``(U, V)`` are also in ``A`` which can be directly
|
1177
|
+
verified.
|
1178
|
+
|
1179
|
+
The algorithm is not changed if one replaces `pdf` by k * `pdf` for any
|
1180
|
+
constant k > 0. Thus, it is often convenient to work with a function
|
1181
|
+
that is proportional to the probability density function by dropping
|
1182
|
+
unnecessary normalization factors.
|
1183
|
+
|
1184
|
+
Intuitively, the method works well if ``A`` fills up most of the
|
1185
|
+
enclosing rectangle such that the probability is high that ``(U, V)``
|
1186
|
+
lies in ``A`` whenever it lies in ``R`` as the number of required
|
1187
|
+
iterations becomes too large otherwise. To be more precise, note that
|
1188
|
+
the expected number of iterations to draw ``(U, V)`` uniformly
|
1189
|
+
distributed on ``R`` such that ``(U, V)`` is also in ``A`` is given by
|
1190
|
+
the ratio ``area(R) / area(A) = 2 * umax * (vmax - vmin) / area(pdf)``,
|
1191
|
+
where `area(pdf)` is the integral of `pdf` (which is equal to one if the
|
1192
|
+
probability density function is used but can take on other values if a
|
1193
|
+
function proportional to the density is used). The equality holds since
|
1194
|
+
the area of ``A`` is equal to ``0.5 * area(pdf)`` (Theorem 7.1 in [1]_).
|
1195
|
+
If the sampling fails to generate a single random variate after 50000
|
1196
|
+
iterations (i.e. not a single draw is in ``A``), an exception is raised.
|
1197
|
+
|
1198
|
+
If the bounding rectangle is not correctly specified (i.e. if it does not
|
1199
|
+
contain ``A``), the algorithm samples from a distribution different from
|
1200
|
+
the one given by `pdf`. It is therefore recommended to perform a
|
1201
|
+
test such as `~scipy.stats.kstest` as a check.
|
1202
|
+
|
1203
|
+
References
|
1204
|
+
----------
|
1205
|
+
.. [1] L. Devroye, "Non-Uniform Random Variate Generation",
|
1206
|
+
Springer-Verlag, 1986.
|
1207
|
+
|
1208
|
+
.. [2] W. Hoermann and J. Leydold, "Generating generalized inverse Gaussian
|
1209
|
+
random variates", Statistics and Computing, 24(4), p. 547--557, 2014.
|
1210
|
+
|
1211
|
+
.. [3] A.J. Kinderman and J.F. Monahan, "Computer Generation of Random
|
1212
|
+
Variables Using the Ratio of Uniform Deviates",
|
1213
|
+
ACM Transactions on Mathematical Software, 3(3), p. 257--260, 1977.
|
1214
|
+
|
1215
|
+
Examples
|
1216
|
+
--------
|
1217
|
+
>>> import numpy as np
|
1218
|
+
>>> from scipy import stats
|
1219
|
+
|
1220
|
+
>>> from scipy.stats.sampling import RatioUniforms
|
1221
|
+
>>> rng = np.random.default_rng()
|
1222
|
+
|
1223
|
+
Simulate normally distributed random variables. It is easy to compute the
|
1224
|
+
bounding rectangle explicitly in that case. For simplicity, we drop the
|
1225
|
+
normalization factor of the density.
|
1226
|
+
|
1227
|
+
>>> f = lambda x: np.exp(-x**2 / 2)
|
1228
|
+
>>> v = np.sqrt(f(np.sqrt(2))) * np.sqrt(2)
|
1229
|
+
>>> umax = np.sqrt(f(0))
|
1230
|
+
>>> gen = RatioUniforms(f, umax=umax, vmin=-v, vmax=v, random_state=rng)
|
1231
|
+
>>> r = gen.rvs(size=2500)
|
1232
|
+
|
1233
|
+
The K-S test confirms that the random variates are indeed normally
|
1234
|
+
distributed (normality is not rejected at 5% significance level):
|
1235
|
+
|
1236
|
+
>>> stats.kstest(r, 'norm')[1]
|
1237
|
+
0.250634764150542
|
1238
|
+
|
1239
|
+
The exponential distribution provides another example where the bounding
|
1240
|
+
rectangle can be determined explicitly.
|
1241
|
+
|
1242
|
+
>>> gen = RatioUniforms(lambda x: np.exp(-x), umax=1, vmin=0,
|
1243
|
+
... vmax=2*np.exp(-1), random_state=rng)
|
1244
|
+
>>> r = gen.rvs(1000)
|
1245
|
+
>>> stats.kstest(r, 'expon')[1]
|
1246
|
+
0.21121052054580314
|
1247
|
+
|
1248
|
+
"""
|
1249
|
+
|
1250
|
+
def __init__(self, pdf, *, umax, vmin, vmax, c=0, random_state=None):
|
1251
|
+
if vmin >= vmax:
|
1252
|
+
raise ValueError("vmin must be smaller than vmax.")
|
1253
|
+
|
1254
|
+
if umax <= 0:
|
1255
|
+
raise ValueError("umax must be positive.")
|
1256
|
+
|
1257
|
+
self._pdf = pdf
|
1258
|
+
self._umax = umax
|
1259
|
+
self._vmin = vmin
|
1260
|
+
self._vmax = vmax
|
1261
|
+
self._c = c
|
1262
|
+
self._rng = check_random_state(random_state)
|
1263
|
+
|
1264
|
+
def rvs(self, size=1):
|
1265
|
+
"""Sampling of random variates
|
1266
|
+
|
1267
|
+
Parameters
|
1268
|
+
----------
|
1269
|
+
size : int or tuple of ints, optional
|
1270
|
+
Number of random variates to be generated (default is 1).
|
1271
|
+
|
1272
|
+
Returns
|
1273
|
+
-------
|
1274
|
+
rvs : ndarray
|
1275
|
+
The random variates distributed according to the probability
|
1276
|
+
distribution defined by the pdf.
|
1277
|
+
|
1278
|
+
"""
|
1279
|
+
size1d = tuple(np.atleast_1d(size))
|
1280
|
+
N = np.prod(size1d) # number of rvs needed, reshape upon return
|
1281
|
+
|
1282
|
+
# start sampling using ratio of uniforms method
|
1283
|
+
x = np.zeros(N)
|
1284
|
+
simulated, i = 0, 1
|
1285
|
+
|
1286
|
+
# loop until N rvs have been generated: expected runtime is finite.
|
1287
|
+
# to avoid infinite loop, raise exception if not a single rv has been
|
1288
|
+
# generated after 50000 tries. even if the expected number of iterations
|
1289
|
+
# is 1000, the probability of this event is (1-1/1000)**50000
|
1290
|
+
# which is of order 10e-22
|
1291
|
+
while simulated < N:
|
1292
|
+
k = N - simulated
|
1293
|
+
# simulate uniform rvs on [0, umax] and [vmin, vmax]
|
1294
|
+
u1 = self._umax * self._rng.uniform(size=k)
|
1295
|
+
v1 = self._rng.uniform(self._vmin, self._vmax, size=k)
|
1296
|
+
# apply rejection method
|
1297
|
+
rvs = v1 / u1 + self._c
|
1298
|
+
accept = (u1**2 <= self._pdf(rvs))
|
1299
|
+
num_accept = np.sum(accept)
|
1300
|
+
if num_accept > 0:
|
1301
|
+
x[simulated:(simulated + num_accept)] = rvs[accept]
|
1302
|
+
simulated += num_accept
|
1303
|
+
|
1304
|
+
if (simulated == 0) and (i*N >= 50000):
|
1305
|
+
msg = (
|
1306
|
+
f"Not a single random variate could be generated in {i*N} "
|
1307
|
+
"attempts. The ratio of uniforms method does not appear "
|
1308
|
+
"to work for the provided parameters. Please check the "
|
1309
|
+
"pdf and the bounds."
|
1310
|
+
)
|
1311
|
+
raise RuntimeError(msg)
|
1312
|
+
i += 1
|
1313
|
+
|
1314
|
+
return np.reshape(x, size1d)
|