derivkit 1.0.2__tar.gz → 1.2.0__tar.gz
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.
- {derivkit-1.0.2 → derivkit-1.2.0}/.github/workflows/ci.yml +2 -2
- {derivkit-1.0.2 → derivkit-1.2.0}/.github/workflows/docs.yml +4 -2
- derivkit-1.2.0/CHANGELOG.md +36 -0
- derivkit-1.2.0/CITATION.cff +40 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/PKG-INFO +22 -15
- derivkit-1.2.0/README.md +32 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/_static/derivkit.css +36 -1
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/_templates/sidebar/variant-selector.html +8 -6
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/about/kits/forecast_kit.rst +26 -2
- derivkit-1.2.0/docs/api/derivkit.utils.caching.rst +7 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.utils.rst +2 -0
- derivkit-1.2.0/docs/api/derivkit.utils.thread_safety.rst +7 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/citation.rst +8 -5
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/contributing.rst +3 -1
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/calculus/gradient.rst +4 -4
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/calculus/hessian.rst +4 -4
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/calculus/hyperhessian.rst +16 -15
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/calculus/jacobian.rst +3 -3
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/derivatives/adaptive_fit.rst +7 -7
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/derivatives/finite_differences.rst +7 -7
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/derivatives/local_poly.rst +5 -5
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/derivatives/multiple_points.rst +5 -3
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/derivatives/tabulated.rst +3 -3
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/forecasting/dali.rst +3 -3
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/forecasting/dali_contours.rst +8 -8
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/forecasting/fisher.rst +4 -4
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/forecasting/fisher_bias.rst +30 -11
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/forecasting/fisher_contours.rst +6 -6
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/forecasting/fisher_gauss.rst +2 -2
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/forecasting/fisher_xy.rst +16 -22
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/forecasting/laplace_approx.rst +3 -3
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/forecasting/laplace_contours.rst +4 -4
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/likelihoods/gaussian.rst +4 -4
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/likelihoods/poissonian.rst +3 -3
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/workflows.rst +47 -9
- {derivkit-1.0.2 → derivkit-1.2.0}/pyproject.toml +31 -12
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/__init__.py +4 -1
- derivkit-1.2.0/src/derivkit/calculus/gradient.py +168 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/calculus/hessian.py +188 -67
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/calculus/hyper_hessian.py +126 -39
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/calculus/jacobian.py +52 -19
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/calculus_kit.py +16 -1
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivative_kit.py +68 -23
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/forecast_kit.py +131 -8
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/likelihood_kit.py +1 -1
- derivkit-1.2.0/src/derivkit/utils/caching.py +149 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/utils/concurrency.py +106 -8
- derivkit-1.2.0/src/derivkit/utils/thread_safety.py +25 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit.egg-info/PKG-INFO +22 -15
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit.egg-info/SOURCES.txt +19 -3
- derivkit-1.2.0/src/derivkit.egg-info/requires.txt +10 -0
- derivkit-1.2.0/tests/benchmarks/test_cache_calculus.py +486 -0
- derivkit-1.2.0/tests/benchmarks/test_cache_derivatives.py +277 -0
- derivkit-1.2.0/tests/benchmarks/test_cache_forecasting.py +606 -0
- derivkit-1.2.0/tests/benchmarks/test_cache_forecasting_ccl_pipeline.py +600 -0
- derivkit-1.2.0/tests/benchmarks/test_cache_forecasting_numerics.py +353 -0
- derivkit-1.2.0/tests/test_calculus_gradient_cache.py +248 -0
- derivkit-1.2.0/tests/test_calculus_hessian_cache.py +192 -0
- derivkit-1.2.0/tests/test_calculus_hyper_hessian_cache.py +97 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_calculus_jacobian.py +20 -0
- derivkit-1.2.0/tests/test_calculus_jacobian_cache.py +253 -0
- derivkit-1.0.2/tests/test_caclulus_kit.py → derivkit-1.2.0/tests/test_calculus_kit.py +95 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_derivative_kit.py +9 -6
- derivkit-1.2.0/tests/test_derivative_kit_caching.py +210 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecast_kit.py +323 -2
- derivkit-1.2.0/tests/test_public_api.py +18 -0
- derivkit-1.2.0/tests/test_utils_caching.py +273 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_utils_concurrency.py +37 -10
- derivkit-1.2.0/tests/test_utils_thread_safety.py +132 -0
- derivkit-1.0.2/CHANGELOG.md +0 -8
- derivkit-1.0.2/CITATION.cff +0 -19
- derivkit-1.0.2/README.md +0 -14
- derivkit-1.0.2/src/derivkit/calculus/gradient.py +0 -97
- derivkit-1.0.2/src/derivkit.egg-info/requires.txt +0 -24
- derivkit-1.0.2/uv.lock +0 -2832
- {derivkit-1.0.2 → derivkit-1.2.0}/.github/ISSUE_TEMPLATE/derivkit-adoption.yml +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/.github/scripts/adoption_from_issue.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/.github/workflows/adoption-issue-to-pr.yml +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/.github/workflows/publish.yml +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/.gitignore +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/LICENSE +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/Makefile +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/_ext/adoption.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/_static/logos/logo-black.png +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/_static/logos/logo-blue.png +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/_templates/pages_redirect.html +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/about/index.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/about/kits/calculus_kit.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/about/kits/derivative_kit.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/about/kits/index.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/about/kits/likelihood_kit.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/about/overview.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/adoption/software/augur.yml +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/adoption/software/cocoa.yml +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.calculus.calculus_core.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.calculus.gradient.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.calculus.hessian.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.calculus.hyper_hessian.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.calculus.jacobian.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.calculus.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.calculus_kit.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivative_kit.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.adaptive.adaptive_fit.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.adaptive.batch_eval.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.adaptive.diagnostics.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.adaptive.grid.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.adaptive.polyfit_utils.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.adaptive.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.adaptive.spacing.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.adaptive.transforms.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.autodiff.jax_autodiff.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.autodiff.jax_core.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.autodiff.jax_utils.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.autodiff.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.finite.batch_eval.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.finite.core.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.finite.extrapolators.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.finite.finite_difference.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.finite.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.finite.stencil.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.fornberg.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.local_polynomial_derivative.diagnostics.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.local_polynomial_derivative.fit.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.local_polynomial_derivative.local_poly_config.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.local_polynomial_derivative.local_polynomial_derivative.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.local_polynomial_derivative.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.local_polynomial_derivative.sampling.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.tabulated_model.one_d.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.derivatives.tabulated_model.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.forecast_kit.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.forecasting.dali.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.forecasting.expansions.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.forecasting.fisher.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.forecasting.fisher_gaussian.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.forecasting.fisher_xy.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.forecasting.forecast_core.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.forecasting.getdist_dali_samples.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.forecasting.getdist_fisher_samples.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.forecasting.laplace.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.forecasting.priors_core.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.forecasting.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.forecasting.sampling_utils.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.likelihood_kit.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.likelihoods.gaussian.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.likelihoods.poisson.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.likelihoods.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.utils.concurrency.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.utils.extrapolation.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.utils.linalg.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.utils.logger.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.utils.numerics.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.utils.sandbox.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.utils.types.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/derivkit.utils.validate.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/api/index.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/assets/favicon.png +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/assets/logos/logo-black.png +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/assets/logos/logo-blue.png +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/assets/logos/logo-red.png +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/assets/logos/logo-yellow.png +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/assets/plots/adaptive_demo_linear_noisy_order1.png +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/assets/plots/dali_vs_fisher_2d_1and2sigma.png +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/assets/plots/dali_vs_fisher_exact_1d.png +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/assets/plots/fisher_bias_demo_1and2sigma.png +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/conf.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/calculus/index.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/derivatives/index.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/forecasting/index.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/index.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/examples/likelihoods/index.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/index.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/installation.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/license.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/make.bat +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/docs/team.rst +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/setup.cfg +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/calculus/__init__.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/calculus/calculus_core.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/__init__.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/adaptive/__init__.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/adaptive/adaptive_fit.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/adaptive/batch_eval.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/adaptive/diagnostics.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/adaptive/grid.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/adaptive/polyfit_utils.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/adaptive/spacing.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/adaptive/transforms.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/autodiff/__init__.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/autodiff/jax_autodiff.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/autodiff/jax_core.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/autodiff/jax_utils.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/finite/__init__.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/finite/batch_eval.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/finite/core.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/finite/extrapolators.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/finite/finite_difference.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/finite/stencil.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/fornberg.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/local_polynomial_derivative/__init__.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/local_polynomial_derivative/diagnostics.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/local_polynomial_derivative/fit.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/local_polynomial_derivative/local_poly_config.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/local_polynomial_derivative/local_polynomial_derivative.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/local_polynomial_derivative/sampling.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/tabulated_model/__init__.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/derivatives/tabulated_model/one_d.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/forecasting/__init__.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/forecasting/dali.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/forecasting/expansions.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/forecasting/fisher.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/forecasting/fisher_gaussian.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/forecasting/fisher_xy.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/forecasting/forecast_core.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/forecasting/getdist_dali_samples.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/forecasting/getdist_fisher_samples.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/forecasting/laplace.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/forecasting/priors_core.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/forecasting/sampling_utils.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/likelihoods/__init__.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/likelihoods/gaussian.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/likelihoods/poisson.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/utils/__init__.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/utils/extrapolation.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/utils/linalg.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/utils/logger.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/utils/numerics.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/utils/sandbox.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/utils/types.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit/utils/validate.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit.egg-info/dependency_links.txt +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/src/derivkit.egg-info/top_level.txt +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/conftest.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_adaptive_fit.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_adaptive_fit_batch_eval.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_adaptive_fit_batch_eval_speed.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_adaptive_fit_grid.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_adaptive_fit_polyfit_utils.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_adaptive_fit_spacing.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_adaptive_fit_transforms.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_autodiff_jax_autodiff.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_autodiff_jax_core.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_autodiff_jax_utils.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_calculus_calculus_core.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_calculus_gradient.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_calculus_hessian.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_calculus_hyper_hessian.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_derivative_kit_methods_grid.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_derivative_kit_output_layout.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_finite_diff.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_finite_diff_core.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_finite_diff_extrapolators.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_finite_diff_fornberg.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_finite_diff_richardson.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_finite_diff_threads.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_finite_diff_validation.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecast_expansions.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecast_fisher_gaussian.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecast_fisher_xy.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecast_forecast_core.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecast_getdist_dali_samples.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecast_getdist_fisher_samples.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecast_integration_sampling_utils.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecast_kit_dali.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecast_kit_fisher.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecast_kit_fisher_bias.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecast_kit_parallel.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecast_laplace.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecast_priors_core.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecast_sampling_utils.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_forecasting_fisher_xy.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_known_derivatives.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_likelihood_kit.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_likelihoods_gaussian.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_likelihoods_poisson.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_local_poly_deriv.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_local_poly_deriv_config.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_local_poly_deriv_fit.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_local_poly_deriv_sampling.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_local_poly_deriv_vs_finite_adaptive.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_tabulated_one_d.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_tabulated_one_d_calculus.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_tabulated_one_d_derivatives.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_tabulated_one_d_forecasting.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_utils_extrapolation.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_utils_linalg.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_utils_numerics.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_utils_sandbox.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_utils_validate_pt1.py +0 -0
- {derivkit-1.0.2 → derivkit-1.2.0}/tests/test_utils_validate_pt2.py +0 -0
|
@@ -26,7 +26,7 @@ jobs:
|
|
|
26
26
|
python-version: ${{ matrix.python-version }}
|
|
27
27
|
|
|
28
28
|
- name: Install dependencies
|
|
29
|
-
run: uv sync --
|
|
29
|
+
run: uv sync --group test
|
|
30
30
|
|
|
31
31
|
- name: Run tests
|
|
32
32
|
run: uv run tox -m test
|
|
@@ -46,7 +46,7 @@ jobs:
|
|
|
46
46
|
version: "0.8.22" # Fix the version of uv
|
|
47
47
|
|
|
48
48
|
- name: Install dependencies
|
|
49
|
-
run: uv sync --
|
|
49
|
+
run: uv sync --group lint
|
|
50
50
|
|
|
51
51
|
- name: Run ruff
|
|
52
52
|
run: uv run tox -e lint -- --output-format github
|
|
@@ -13,7 +13,9 @@ jobs:
|
|
|
13
13
|
permissions:
|
|
14
14
|
contents: write
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@v6
|
|
17
|
+
with:
|
|
18
|
+
fetch-depth: 0
|
|
17
19
|
|
|
18
20
|
- uses: actions/setup-python@v3
|
|
19
21
|
with:
|
|
@@ -21,7 +23,7 @@ jobs:
|
|
|
21
23
|
|
|
22
24
|
- name: Install dependencies
|
|
23
25
|
run: |
|
|
24
|
-
pip install -e .
|
|
26
|
+
pip install --group dev -e .
|
|
25
27
|
|
|
26
28
|
- name: Sphinx build
|
|
27
29
|
run: |
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v1.2.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
* Added thread-safety options to `ForecastKit` and `CalculusKit`.
|
|
8
|
+
* Added a multiprocessing support to `parallel_execute()`, which avoids the Python GIL.
|
|
9
|
+
* Added input-level caching of function evaluations.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
* Exposed the $X-Y$ Gaussian Fisher matrix through `ForecastKit.xy_fisher()`.
|
|
14
|
+
* Improved the general documentation.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## v1.1.0
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
* Added caching of function and derivative values for forecasting.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## v1.0.2
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
* Fixed how `dk_kwargs` are passed to `ForecastKit`.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## v1.0.1
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
* Fixed an issue where the Hessian routine would repeatedly evaluate the input function if the function is vector-valued.
|
|
36
|
+
* Fixed an issue where the Hyper-Hessian routine would repeatedly evaluate the input function if the function is vector-valued.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use DerivKit, please cite it as below."
|
|
3
|
+
title: "DerivKit"
|
|
4
|
+
type: software
|
|
5
|
+
|
|
6
|
+
authors:
|
|
7
|
+
- given-names: "Nikolina"
|
|
8
|
+
family-names: "Šarčević"
|
|
9
|
+
email: "nikolina.sarcevic@gmail.com"
|
|
10
|
+
orcid: "0000-0001-7301-6415"
|
|
11
|
+
- given-names: "Matthijs"
|
|
12
|
+
family-names: "van der Wild"
|
|
13
|
+
email: "matthijs@vanderwild.com"
|
|
14
|
+
orcid: "0000-0002-3949-3063"
|
|
15
|
+
- given-names: "Cynthia"
|
|
16
|
+
family-names: "Trendafilova"
|
|
17
|
+
email: "cyntrendafilova@gmail.com"
|
|
18
|
+
orcid: "0000-0001-5500-4058"
|
|
19
|
+
|
|
20
|
+
license: "MIT"
|
|
21
|
+
repository-code: "https://github.com/derivkit/derivkit"
|
|
22
|
+
|
|
23
|
+
preferred-citation:
|
|
24
|
+
type: article
|
|
25
|
+
title: "DerivKit: stable numerical derivatives bridging Fisher forecasts and MCMC"
|
|
26
|
+
authors:
|
|
27
|
+
- given-names: "Nikolina"
|
|
28
|
+
family-names: "Šarčević"
|
|
29
|
+
orcid: "https://orcid.org/0000-0001-7301-6415"
|
|
30
|
+
- given-names: "Matthijs"
|
|
31
|
+
family-names: "van der Wild"
|
|
32
|
+
orcid: "https://orcid.org/0000-0002-3949-3063"
|
|
33
|
+
- given-names: "Cynthia"
|
|
34
|
+
family-names: "Trendafilova"
|
|
35
|
+
orcid: "https://orcid.org/0000-0001-5500-4058"
|
|
36
|
+
year: 2026
|
|
37
|
+
url: "https://arxiv.org/abs/2602.08078"
|
|
38
|
+
identifiers:
|
|
39
|
+
- type: other
|
|
40
|
+
value: "arXiv:2602.08078"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: derivkit
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: A robust toolkit for stable numerical derivatives
|
|
5
5
|
Author-email: Nikolina Šarčević <nikolina.sarcevic@gmail.com>, Matthijs van der Wild <matthijs@vanderwild.com>, Cynthia Trendafilova <cyntrendafilova@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -16,19 +16,8 @@ Requires-Dist: numdifftools
|
|
|
16
16
|
Requires-Dist: numpy
|
|
17
17
|
Requires-Dist: multiprocess
|
|
18
18
|
Requires-Dist: scipy
|
|
19
|
-
Requires-Dist: tox
|
|
20
19
|
Requires-Dist: getdist
|
|
21
20
|
Requires-Dist: emcee
|
|
22
|
-
Provides-Extra: test
|
|
23
|
-
Requires-Dist: pytest; extra == "test"
|
|
24
|
-
Provides-Extra: docs
|
|
25
|
-
Requires-Dist: sphinx<9; extra == "docs"
|
|
26
|
-
Requires-Dist: sphinx-design; extra == "docs"
|
|
27
|
-
Requires-Dist: sphinx-multiversion; extra == "docs"
|
|
28
|
-
Requires-Dist: furo; extra == "docs"
|
|
29
|
-
Requires-Dist: sphinx-copybutton; extra == "docs"
|
|
30
|
-
Provides-Extra: lint
|
|
31
|
-
Requires-Dist: ruff; extra == "lint"
|
|
32
21
|
Provides-Extra: jax
|
|
33
22
|
Requires-Dist: jax>=0.4; extra == "jax"
|
|
34
23
|
Requires-Dist: jaxlib>=0.4; extra == "jax"
|
|
@@ -36,9 +25,10 @@ Dynamic: license-file
|
|
|
36
25
|
|
|
37
26
|
# derivkit
|
|
38
27
|
|
|
39
|
-
[](LICENSE)
|
|
28
|
+
[](https://github.com/derivkit/derivkit/actions/workflows/ci.yml)
|
|
29
|
+
[](https://github.com/derivkit/derivkit/actions/workflows/docs.yml)
|
|
30
|
+
[](LICENSE)
|
|
31
|
+
[](https://pypi.org/project/derivkit/)
|
|
42
32
|
|
|
43
33
|
|
|
44
34
|
**DerivKit** is a robust Python toolkit for stable numerical derivatives, built for scientific computing, cosmology, and any domain requiring accurate gradients or higher-order expansions.
|
|
@@ -46,5 +36,22 @@ Dynamic: license-file
|
|
|
46
36
|
Detailed documentation, examples, and API reference can be found at the [derivkit documentation](https://docs.derivkit.org).
|
|
47
37
|
|
|
48
38
|
|
|
39
|
+
## Citation
|
|
40
|
+
|
|
41
|
+
If you use **DerivKit** in your research, please cite the associated paper:
|
|
42
|
+
|
|
43
|
+
```bibtex
|
|
44
|
+
@misc{sarcevic2026derivkitstablenumericalderivatives,
|
|
45
|
+
title = {DerivKit: stable numerical derivatives bridging Fisher forecasts and MCMC},
|
|
46
|
+
author = {Šarčević, Nikolina and van der Wild, Matthijs and Trendafilova, Cynthia},
|
|
47
|
+
year = {2026},
|
|
48
|
+
eprint = {2602.08078},
|
|
49
|
+
archivePrefix= {arXiv},
|
|
50
|
+
primaryClass = {astro-ph.IM},
|
|
51
|
+
url = {https://arxiv.org/abs/2602.08078}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
|
|
49
56
|
## License
|
|
50
57
|
MIT License © 2025 Niko Šarčević, Matthijs van der Wild, Cynthia Trendafilova and contributors.
|
derivkit-1.2.0/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# derivkit
|
|
2
|
+
|
|
3
|
+
[](https://github.com/derivkit/derivkit/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/derivkit/derivkit/actions/workflows/docs.yml)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://pypi.org/project/derivkit/)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
**DerivKit** is a robust Python toolkit for stable numerical derivatives, built for scientific computing, cosmology, and any domain requiring accurate gradients or higher-order expansions.
|
|
10
|
+
|
|
11
|
+
Detailed documentation, examples, and API reference can be found at the [derivkit documentation](https://docs.derivkit.org).
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## Citation
|
|
15
|
+
|
|
16
|
+
If you use **DerivKit** in your research, please cite the associated paper:
|
|
17
|
+
|
|
18
|
+
```bibtex
|
|
19
|
+
@misc{sarcevic2026derivkitstablenumericalderivatives,
|
|
20
|
+
title = {DerivKit: stable numerical derivatives bridging Fisher forecasts and MCMC},
|
|
21
|
+
author = {Šarčević, Nikolina and van der Wild, Matthijs and Trendafilova, Cynthia},
|
|
22
|
+
year = {2026},
|
|
23
|
+
eprint = {2602.08078},
|
|
24
|
+
archivePrefix= {arXiv},
|
|
25
|
+
primaryClass = {astro-ph.IM},
|
|
26
|
+
url = {https://arxiv.org/abs/2602.08078}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## License
|
|
32
|
+
MIT License © 2025 Niko Šarčević, Matthijs van der Wild, Cynthia Trendafilova and contributors.
|
|
@@ -193,4 +193,39 @@ div.plot-directive img,
|
|
|
193
193
|
div.figure img {
|
|
194
194
|
max-width: 520px;
|
|
195
195
|
height: auto;
|
|
196
|
-
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* ==========================================================================
|
|
199
|
+
DerivKit — Furo sidebar typography
|
|
200
|
+
========================================================================== */
|
|
201
|
+
|
|
202
|
+
/* Slightly larger sidebar base text */
|
|
203
|
+
.sidebar-container {
|
|
204
|
+
font-size: 1.02rem !important;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* Main navigation links (Furo) */
|
|
208
|
+
.sidebar-tree a {
|
|
209
|
+
font-size: 1.08rem !important;
|
|
210
|
+
line-height: 1.4 !important;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* Section headers / captions inside the sidebar */
|
|
214
|
+
.sidebar-tree .caption-text {
|
|
215
|
+
font-size: 1.05rem !important;
|
|
216
|
+
font-weight: 600 !important;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* Search box text */
|
|
220
|
+
.sidebar-search input {
|
|
221
|
+
font-size: 1.02rem !important;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* Optional: tiny spacing improvement */
|
|
225
|
+
.sidebar-tree li {
|
|
226
|
+
margin-bottom: 0.15rem !important;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.sidebar-tree a {
|
|
230
|
+
padding: 0.15rem 0 !important;
|
|
231
|
+
}
|
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
<li class="toctree-l1"><a class="reference" href="{{ item.url }}">{{ item.name }}</a></li>
|
|
7
7
|
{%- endfor %}
|
|
8
8
|
</ul>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
<details>
|
|
10
|
+
<summary class="caption" role="heading"><span class="caption-text">{{ _('Versions') }}</span></summary>
|
|
11
|
+
<ul>
|
|
12
|
+
{%- for item in versions.tags | reverse %}
|
|
13
|
+
<li class="toctree-l1"><a class="reference" href="{{ item.url }}">{{ item.name }}</a></li>
|
|
14
|
+
{%- endfor %}
|
|
15
|
+
</ul>
|
|
16
|
+
</details>
|
|
15
17
|
</div>
|
|
16
18
|
{% endif %}
|
|
@@ -197,6 +197,8 @@ Examples
|
|
|
197
197
|
A worked example is provided in :doc:`../../examples/forecasting/fisher_xy`.
|
|
198
198
|
|
|
199
199
|
|
|
200
|
+
.. _forecastkit-fisher-bias:
|
|
201
|
+
|
|
200
202
|
Fisher Bias
|
|
201
203
|
-----------
|
|
202
204
|
|
|
@@ -228,12 +230,34 @@ ForecastKit returns:
|
|
|
228
230
|
Interpretation
|
|
229
231
|
^^^^^^^^^^^^^^
|
|
230
232
|
|
|
231
|
-
Fisher bias
|
|
232
|
-
|
|
233
|
+
Fisher bias characterizes the impact of model incompleteness rather than explicit
|
|
234
|
+
parameter perturbations. The difference vector :math:`\Delta\nu` represents a
|
|
235
|
+
systematic mismatch between the true data-generating model and the model assumed
|
|
236
|
+
in analysis, evaluated at the same fiducial parameters. The resulting shift
|
|
237
|
+
:math:`\Delta\theta` estimates how the inferred best-fit parameters would
|
|
238
|
+
move in order to absorb this mismatch if the systematic were neglected.
|
|
239
|
+
Fisher bias should therefore be interpreted as a diagnostic of whether a
|
|
240
|
+
given systematic can be safely ignored within a local Gaussian approximation.
|
|
233
241
|
|
|
234
242
|
.. image:: ../../assets/plots/fisher_bias_demo_1and2sigma.png
|
|
235
243
|
:width: 60%
|
|
236
244
|
|
|
245
|
+
In practice, the two data vectors entering :math:`\Delta\nu` are obtained
|
|
246
|
+
by evaluating two models at the same fiducial parameters: a baseline model used
|
|
247
|
+
for inference and a more complete model that includes additional physical or
|
|
248
|
+
instrumental systematics. Fisher bias then estimates how the inferred parameters
|
|
249
|
+
would shift if data generated by the more complete model were analyzed using the
|
|
250
|
+
baseline model alone. In this sense, Fisher bias quantifies the parameter impact
|
|
251
|
+
of neglecting specific systematic effects, rather than correcting for them.
|
|
252
|
+
|
|
253
|
+
The difference vector :math:`\Delta\nu_i` can be defined with either sign convention, *e.g.*
|
|
254
|
+
:math:`\pm\Delta\nu_i = \nu_i^{\mathrm{biased}} - \nu_i^{\mathrm{unbiased}}`.
|
|
255
|
+
The chosen convention fixes the interpretation of the resulting
|
|
256
|
+
parameter shift :math:`\Delta\theta`: changing the sign of :math:`\Delta\nu`
|
|
257
|
+
simply reverses the direction of the inferred bias and must be interpreted
|
|
258
|
+
accordingly.
|
|
259
|
+
|
|
260
|
+
|
|
237
261
|
Examples
|
|
238
262
|
^^^^^^^^
|
|
239
263
|
|
|
@@ -7,12 +7,14 @@ Submodules
|
|
|
7
7
|
.. toctree::
|
|
8
8
|
:maxdepth: 2
|
|
9
9
|
|
|
10
|
+
derivkit.utils.caching
|
|
10
11
|
derivkit.utils.concurrency
|
|
11
12
|
derivkit.utils.extrapolation
|
|
12
13
|
derivkit.utils.linalg
|
|
13
14
|
derivkit.utils.logger
|
|
14
15
|
derivkit.utils.numerics
|
|
15
16
|
derivkit.utils.sandbox
|
|
17
|
+
derivkit.utils.thread_safety
|
|
16
18
|
derivkit.utils.types
|
|
17
19
|
derivkit.utils.validate
|
|
18
20
|
|
|
@@ -14,11 +14,14 @@ How to cite DerivKit
|
|
|
14
14
|
|
|
15
15
|
.. code-block:: bibtex
|
|
16
16
|
|
|
17
|
-
@
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
@misc{sarcevic2026derivkitstablenumericalderivatives,
|
|
18
|
+
title = {DerivKit: stable numerical derivatives bridging Fisher forecasts and MCMC},
|
|
19
|
+
author = {Šarčević, Nikolina and van der Wild, Matthijs and Trendafilova, Cynthia},
|
|
20
|
+
year = {2026},
|
|
21
|
+
eprint = {2602.08078},
|
|
22
|
+
archivePrefix = {arXiv},
|
|
23
|
+
primaryClass = {astro-ph.IM},
|
|
24
|
+
url = {https://arxiv.org/abs/2602.08078}
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
|
|
@@ -50,7 +50,9 @@ Running ``derivkit`` workflows
|
|
|
50
50
|
******************************
|
|
51
51
|
|
|
52
52
|
``derivkit`` uses `tox <https://tox.wiki>`__ to run its workflows.
|
|
53
|
-
It
|
|
53
|
+
It can be installed along with ``derivkit`` by adding the ``dev`` group::
|
|
54
|
+
|
|
55
|
+
pip install --group dev derivkit
|
|
54
56
|
|
|
55
57
|
All workflows can be run consecutively by simply calling tox from the project root directory::
|
|
56
58
|
|
|
@@ -38,7 +38,7 @@ Basic usage
|
|
|
38
38
|
.. doctest:: gradient_basic
|
|
39
39
|
|
|
40
40
|
>>> import numpy as np
|
|
41
|
-
>>> from derivkit
|
|
41
|
+
>>> from derivkit import CalculusKit
|
|
42
42
|
>>> # Define a scalar-valued function
|
|
43
43
|
>>> def func(theta):
|
|
44
44
|
... return np.sin(theta[0]) + theta[1] ** 2
|
|
@@ -60,7 +60,7 @@ Finite differences (Ridders) via ``dk_kwargs``
|
|
|
60
60
|
.. doctest:: gradient_finite_ridders
|
|
61
61
|
|
|
62
62
|
>>> import numpy as np
|
|
63
|
-
>>> from derivkit
|
|
63
|
+
>>> from derivkit import CalculusKit
|
|
64
64
|
>>> # Define a scalar-valued function
|
|
65
65
|
>>> def func(theta):
|
|
66
66
|
... return np.sin(theta[0]) + theta[1] ** 2
|
|
@@ -83,7 +83,7 @@ Adaptive backend via ``dk_kwargs``
|
|
|
83
83
|
.. doctest:: gradient_adaptive
|
|
84
84
|
|
|
85
85
|
>>> import numpy as np
|
|
86
|
-
>>> from derivkit
|
|
86
|
+
>>> from derivkit import CalculusKit
|
|
87
87
|
>>> # Define a scalar-valued function
|
|
88
88
|
>>> def func(theta):
|
|
89
89
|
... return np.sin(theta[0]) + theta[1] ** 2
|
|
@@ -108,7 +108,7 @@ The number of parallel processes can be tuned with the ``n_workers`` parameter.
|
|
|
108
108
|
.. doctest:: gradient_parallel
|
|
109
109
|
|
|
110
110
|
>>> import numpy as np
|
|
111
|
-
>>> from derivkit
|
|
111
|
+
>>> from derivkit import CalculusKit
|
|
112
112
|
>>> # Define a scalar-valued function
|
|
113
113
|
>>> def f(theta):
|
|
114
114
|
... return np.sin(theta[0]) + theta[1] ** 2 + np.cos(theta[2])
|
|
@@ -43,7 +43,7 @@ Basic usage (scalar-valued function)
|
|
|
43
43
|
.. doctest:: hessian_basic
|
|
44
44
|
|
|
45
45
|
>>> import numpy as np
|
|
46
|
-
>>> from derivkit
|
|
46
|
+
>>> from derivkit import CalculusKit
|
|
47
47
|
>>> # Define a scalar-valued function
|
|
48
48
|
>>> def func(theta):
|
|
49
49
|
... return np.sin(theta[0]) + theta[0] * theta[1] + theta[1] ** 2
|
|
@@ -75,7 +75,7 @@ DerivKit provides a fast helper for this case.
|
|
|
75
75
|
.. doctest:: hessian_diag
|
|
76
76
|
|
|
77
77
|
>>> import numpy as np
|
|
78
|
-
>>> from derivkit
|
|
78
|
+
>>> from derivkit import CalculusKit
|
|
79
79
|
>>> # Define a scalar-valued function
|
|
80
80
|
>>> def func(theta):
|
|
81
81
|
... return np.sin(theta[0]) + theta[0] * theta[1] + theta[1] ** 2
|
|
@@ -100,7 +100,7 @@ The result is reshaped back to ``(*out_shape, p, p)``.
|
|
|
100
100
|
.. doctest:: hessian_tensor
|
|
101
101
|
|
|
102
102
|
>>> import numpy as np
|
|
103
|
-
>>> from derivkit
|
|
103
|
+
>>> from derivkit import CalculusKit
|
|
104
104
|
>>> # Define a tensor-valued function
|
|
105
105
|
>>> def func(theta):
|
|
106
106
|
... return np.array([
|
|
@@ -134,7 +134,7 @@ Finite differences (Ridders) via ``dk_kwargs``
|
|
|
134
134
|
.. doctest:: hessian_finite_ridders
|
|
135
135
|
|
|
136
136
|
>>> import numpy as np
|
|
137
|
-
>>> from derivkit
|
|
137
|
+
>>> from derivkit import CalculusKit
|
|
138
138
|
>>> # Define a scalar-valued function
|
|
139
139
|
>>> def func(theta):
|
|
140
140
|
... return np.sin(theta[0]) + theta[0] * theta[1] + theta[1] ** 2
|
|
@@ -39,13 +39,14 @@ Basic usage
|
|
|
39
39
|
.. doctest:: hyper_hessian_basic
|
|
40
40
|
|
|
41
41
|
>>> import numpy as np
|
|
42
|
-
>>> from derivkit
|
|
42
|
+
>>> from derivkit import CalculusKit
|
|
43
43
|
>>> # Define a scalar-valued function with non-zero third derivatives.
|
|
44
44
|
>>> def func(theta):
|
|
45
45
|
... return theta[0] ** 3 + 2.0 * theta[0] * theta[1] + theta[1] ** 2
|
|
46
46
|
>>> theta0 = np.array([0.5, 2.0])
|
|
47
|
-
>>>
|
|
48
|
-
>>>
|
|
47
|
+
>>> ckit = CalculusKit(func, x0=theta0)
|
|
48
|
+
>>> hess3 = ckit.hyper_hessian()
|
|
49
|
+
>>> hess3.shape
|
|
49
50
|
(2, 2, 2)
|
|
50
51
|
>>> # Analytic reference:
|
|
51
52
|
>>> # d^3 f / dtheta0^3 = 6, and all other third partials are zero.
|
|
@@ -55,6 +56,7 @@ Basic usage
|
|
|
55
56
|
True
|
|
56
57
|
|
|
57
58
|
|
|
59
|
+
|
|
58
60
|
Symmetry
|
|
59
61
|
--------
|
|
60
62
|
|
|
@@ -64,13 +66,12 @@ its parameter indices:
|
|
|
64
66
|
.. doctest:: hyper_hessian_symmetry
|
|
65
67
|
|
|
66
68
|
>>> import numpy as np
|
|
67
|
-
>>> from derivkit
|
|
68
|
-
>>>
|
|
69
|
+
>>> from derivkit import CalculusKit
|
|
69
70
|
>>> def func(theta):
|
|
70
71
|
... return theta[0] ** 3 + 2.0 * theta[0] * theta[1] + theta[1] ** 2
|
|
71
|
-
>>>
|
|
72
72
|
>>> theta0 = np.array([0.5, 2.0])
|
|
73
|
-
>>>
|
|
73
|
+
>>> ckit = CalculusKit(func, x0=theta0)
|
|
74
|
+
>>> hess3 = ckit.hyper_hessian()
|
|
74
75
|
>>> # Check symmetry for a representative index triplet.
|
|
75
76
|
>>> bool(hess3[0, 1, 0] == hess3[1, 0, 0] == hess3[0, 0, 1])
|
|
76
77
|
True
|
|
@@ -85,7 +86,7 @@ for each output component and afterwards reshaped back to ``(*out_shape, p, p, p
|
|
|
85
86
|
.. doctest:: hyper_hessian_tensor
|
|
86
87
|
|
|
87
88
|
>>> import numpy as np
|
|
88
|
-
>>> from derivkit
|
|
89
|
+
>>> from derivkit import CalculusKit
|
|
89
90
|
>>> # Two-output function.
|
|
90
91
|
>>> # f0(theta) = theta0^3
|
|
91
92
|
>>> # f1(theta) = theta0*theta1 + theta1^2
|
|
@@ -93,10 +94,11 @@ for each output component and afterwards reshaped back to ``(*out_shape, p, p, p
|
|
|
93
94
|
... return np.array([
|
|
94
95
|
... theta[0] ** 3,
|
|
95
96
|
... theta[0] * theta[1] + theta[1] ** 2,
|
|
96
|
-
... ])
|
|
97
|
+
... ], dtype=float)
|
|
97
98
|
>>> theta0 = np.array([0.5, 2.0])
|
|
98
|
-
>>>
|
|
99
|
-
>>>
|
|
99
|
+
>>> ckit = CalculusKit(func, x0=theta0)
|
|
100
|
+
>>> hess3 = ckit.hyper_hessian()
|
|
101
|
+
>>> hess3.shape
|
|
100
102
|
(2, 2, 2, 2)
|
|
101
103
|
>>>
|
|
102
104
|
>>> # Component 0: only d^3/dtheta0^3 = 6 is non-zero.
|
|
@@ -118,13 +120,12 @@ options via ``**dk_kwargs``.
|
|
|
118
120
|
.. doctest:: hyper_hessian_finite_ridders
|
|
119
121
|
|
|
120
122
|
>>> import numpy as np
|
|
121
|
-
>>> from derivkit
|
|
123
|
+
>>> from derivkit import CalculusKit
|
|
122
124
|
>>> def func(theta):
|
|
123
125
|
... return theta[0] ** 3 + 2.0 * theta[0] * theta[1] + theta[1] ** 2
|
|
124
126
|
>>> theta0 = np.array([0.5, 2.0])
|
|
125
|
-
>>>
|
|
126
|
-
|
|
127
|
-
... theta0,
|
|
127
|
+
>>> ckit = CalculusKit(func, x0=theta0)
|
|
128
|
+
>>> hess3 = ckit.hyper_hessian(
|
|
128
129
|
... method="finite",
|
|
129
130
|
... n_workers=4,
|
|
130
131
|
... extrapolation="ridders",
|
|
@@ -42,7 +42,7 @@ Basic usage
|
|
|
42
42
|
.. doctest:: jacobian_basic
|
|
43
43
|
|
|
44
44
|
>>> import numpy as np
|
|
45
|
-
>>> from derivkit
|
|
45
|
+
>>> from derivkit import CalculusKit
|
|
46
46
|
>>> # Define a vector-valued function
|
|
47
47
|
>>> def func(theta):
|
|
48
48
|
... return np.array([
|
|
@@ -74,7 +74,7 @@ Finite differences (Ridders) via ``dk_kwargs``
|
|
|
74
74
|
.. doctest:: jacobian_finite_ridders
|
|
75
75
|
|
|
76
76
|
>>> import numpy as np
|
|
77
|
-
>>> from derivkit
|
|
77
|
+
>>> from derivkit import CalculusKit
|
|
78
78
|
>>> # Define a vector-valued function
|
|
79
79
|
>>> def func(theta):
|
|
80
80
|
... return np.array([np.sin(theta[0]) + theta[1], theta[0] * theta[1]])
|
|
@@ -99,7 +99,7 @@ Adaptive backend via ``dk_kwargs``
|
|
|
99
99
|
.. doctest:: jacobian_adaptive
|
|
100
100
|
|
|
101
101
|
>>> import numpy as np
|
|
102
|
-
>>> from derivkit
|
|
102
|
+
>>> from derivkit import CalculusKit
|
|
103
103
|
>>> # Define a vector-valued function
|
|
104
104
|
>>> def func(theta):
|
|
105
105
|
... return np.array([np.sin(theta[0]) + theta[1], theta[0] * theta[1]])
|
|
@@ -32,7 +32,7 @@ By default, an adaptive Chebyshev grid is constructed automatically around
|
|
|
32
32
|
.. doctest:: adaptive_basic
|
|
33
33
|
|
|
34
34
|
>>> import numpy as np
|
|
35
|
-
>>> from derivkit
|
|
35
|
+
>>> from derivkit import DerivativeKit
|
|
36
36
|
>>> # Initialize DerivativeKit with the target function and expansion point
|
|
37
37
|
>>> dk = DerivativeKit(function=np.sin, x0=0.7)
|
|
38
38
|
>>> # Compute the first derivative (adaptive backend is the default)
|
|
@@ -60,7 +60,7 @@ Accepted forms for ``spacing`` are:
|
|
|
60
60
|
.. doctest:: adaptive_sampling_control
|
|
61
61
|
|
|
62
62
|
>>> import numpy as np
|
|
63
|
-
>>> from derivkit
|
|
63
|
+
>>> from derivkit import DerivativeKit
|
|
64
64
|
>>> # Initialize DerivativeKit with the target function and expansion point
|
|
65
65
|
>>> dk = DerivativeKit(function=np.sin, x0=0.7)
|
|
66
66
|
>>> # Compute the first derivative with custom sampling
|
|
@@ -84,7 +84,7 @@ The adaptive grid is clipped or transformed as needed to stay inside bounds.
|
|
|
84
84
|
.. doctest:: adaptive_domain
|
|
85
85
|
|
|
86
86
|
>>> import numpy as np
|
|
87
|
-
>>> from derivkit
|
|
87
|
+
>>> from derivkit import DerivativeKit
|
|
88
88
|
>>> # Define a function and an expansion point
|
|
89
89
|
>>> f = np.log
|
|
90
90
|
>>> x0 = 0.05
|
|
@@ -115,7 +115,7 @@ If zero is missing from an offsets grid, it is inserted automatically.
|
|
|
115
115
|
.. doctest:: adaptive_custom_grid
|
|
116
116
|
|
|
117
117
|
>>> import numpy as np
|
|
118
|
-
>>> from derivkit
|
|
118
|
+
>>> from derivkit import DerivativeKit
|
|
119
119
|
>>> dk = DerivativeKit(function=np.sin, x0=0.7)
|
|
120
120
|
>>> offsets = np.array([-2e-2, -1e-2, 1e-2, 2e-2]) # no 0 (inserted automatically)
|
|
121
121
|
>>> deriv = dk.differentiate(method="adaptive", order=1, grid=("offsets", offsets))
|
|
@@ -135,7 +135,7 @@ stability.
|
|
|
135
135
|
.. doctest:: adaptive_ridge
|
|
136
136
|
|
|
137
137
|
>>> import numpy as np
|
|
138
|
-
>>> from derivkit
|
|
138
|
+
>>> from derivkit import DerivativeKit
|
|
139
139
|
>>> dk = DerivativeKit(function=np.sin, x0=0.7)
|
|
140
140
|
>>> deriv = dk.differentiate(
|
|
141
141
|
... method="adaptive",
|
|
@@ -159,7 +159,7 @@ You can request an error proxy and detailed diagnostics from the polynomial fit.
|
|
|
159
159
|
.. doctest:: adaptive_diagnostics
|
|
160
160
|
|
|
161
161
|
>>> import numpy as np
|
|
162
|
-
>>> from derivkit
|
|
162
|
+
>>> from derivkit import DerivativeKit
|
|
163
163
|
>>> dk = DerivativeKit(function=np.sin, x0=0.7)
|
|
164
164
|
>>> deriv, err, diag = dk.differentiate(
|
|
165
165
|
... method="adaptive",
|
|
@@ -186,7 +186,7 @@ function evaluations are noisy.
|
|
|
186
186
|
.. doctest:: adaptive_noisy
|
|
187
187
|
|
|
188
188
|
>>> import numpy as np
|
|
189
|
-
>>> from derivkit
|
|
189
|
+
>>> from derivkit import DerivativeKit
|
|
190
190
|
>>> # Deterministic "noise": sampled once on a grid and interpolated (stable across calls)
|
|
191
191
|
>>> rng = np.random.default_rng(42)
|
|
192
192
|
>>> x_noise = np.linspace(0.0, 2.0, 2049)
|