2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

93 Commits

Author SHA1 Message Date
mzhelyez
8bb3a24162 added graphs 2025-08-24 14:16:55 +02:00
John Maddock
e03fd8bf4f Merge branch 'stat_saspoint5' of https://github.com/tk-yoshimura/boost_math into map_airy_etc 2024-07-25 11:01:48 +01:00
John Maddock
bb25838e82 Merge branch 'stat_holtsmark' of https://github.com/tk-yoshimura/boost_math into map_airy_etc 2024-07-25 11:01:03 +01:00
John Maddock
02e08e165a Merge branch 'stat_mapairy' of https://github.com/tk-yoshimura/boost_math into map_airy_etc 2024-07-25 11:00:19 +01:00
tk-yoshimura
e407cadd0d Add saspoint5 document graphs 2024-07-23 23:21:22 +09:00
tk-yoshimura
f2a0fc9723 Add holtsmark document graphs 2024-07-23 23:12:01 +09:00
tk-yoshimura
72afe90646 Add mapairy document graphs 2024-07-23 22:56:27 +09:00
jzmaddock
07d97df50c Landau Integration testing (#1159)
* Add landau distribution

* Add landau limit test case

* Add landau document

* Landau integration testing.
Hook up tests to Jamfile.
Hook up docs by adding to dist_reference.qbk.
Add std::float64_t tests.
Hook up concept tests in instantiate.hpp.
Add to distributions.hpp
Update static_asserts with better error messages.
Add header inclusion test in dist_landau_incl_test.cpp (and fix resulting errors)

* Add missing #include.

* More Landau test fixes.

* Fix C++23 stdfloat test names.

* Final (doc) update to Landau.

---------

Co-authored-by: tk-yoshimura <yoshimura8192@gmail.com>
2024-07-21 11:54:58 +01:00
Nick
7887d43f83 Numerical evaluation of Fourier transform of Daubechies scaling funct… (#921)
* Numerical evaluation of Fourier transform of Daubechies scaling functions.

* Update example/calculate_fourier_transform_daubechies_constants.cpp

Co-authored-by: Matt Borland <matt@mattborland.com>

* Update example/fourier_transform_daubechies_ulp_plot.cpp

Co-authored-by: Matt Borland <matt@mattborland.com>

* Update include/boost/math/special_functions/fourier_transform_daubechies_scaling.hpp

Co-authored-by: Matt Borland <matt@mattborland.com>

* Update include/boost/math/special_functions/fourier_transform_daubechies_scaling.hpp

Co-authored-by: Matt Borland <matt@mattborland.com>

* Rename include file to reflect it implements both the scaling and wavelet.

* Add performance to docs.

* Update test/math_unit_test.hpp

Co-authored-by: Matt Borland <matt@mattborland.com>

* Add boost-no-inspect to files with non-ASCII characters.

---------

Co-authored-by: Matt Borland <matt@mattborland.com>
2023-06-13 08:05:00 -07:00
Nick
4aac532a88 Add Estrin's method for polynomial evaluation (#932)
* Add Estrin's method for polynomial evaluation

N.B.: This is a slightly modified version of the code provided by Thomas Dybdahl Ahle in a github issue.

[CI SKIP] [ci skip]

* Add comparisons to Horner with std::array.
[CI SKIP]

* Add Estrin's method for polynomial evaluation

N.B.: This is a slightly modified version of the code provided by Thomas Dybdahl Ahle in a github issue.

[CI SKIP] [ci skip]

* Fix hang in n=0 case.

* Fix out of bounds access in test.

* Fix endsect for estrin.qbk.

* Apply clang-format to make the 'inspect' stage happy.

* Add type_traits header to includes.

* Add ulp plot.

* Document decreased accuracy of Estrin's method.

* Add assertion for size of scratch pad

* Remove std::size since it is C++17

* Add C++14 testing

* estrin -> evaluate_polynomial_estrin.

---------

Co-authored-by: jzmaddock <john@johnmaddock.co.uk>
Co-authored-by: Matt Borland <matt@mattborland.com>
2023-02-04 10:32:06 -08:00
jzmaddock
10bd7be0f1 ellint_1/2 performance tweaks.
Add Google bench to probe changes more easily.
Update graphs and docs.
2022-08-17 19:21:03 +01:00
jzmaddock
544258569b Fixes for inspect failures in doc/ and example/ 2021-03-30 11:04:16 +01:00
Matt Borland
26711525ca Remove uses of boost/cstdint without header called 2021-03-21 16:13:10 +03:00
Matt Borland
5ae92ba0c3 Replace several boost types [ci skip] 2021-02-15 16:00:08 +03:00
Matt Borland
bf3038bfcb Add Z-test (#494)
* Initial Commit

* Add tests

* Add docs

* Fix svg file dimensions [CI SKIP]

* Minor fixes [CI SKIP]

* Fixes to docs and tests [CI SKIP]

* More test fixes and cycle CI

* Cycle CI

* Update docs

* Fix for MSVC-14.2 C++17 misc failure [CI SKIP]
2021-01-17 09:53:49 -05:00
Matt Borland
f7e3fc17a6 Additional t-tests (#487)
* Add integer support to t_test

* Add paired samples t test

* Add two sample t test

* Add welch's t test

* Update docs

* Cleanup

* Add CHECK_ULP_CLOSE tests to test battery. Fix svg

* Remove all instances of ex [CI SKIP]

* Remove std::distance and note in docs [CI SKIP]

* Re-write test battery
2021-01-12 15:48:53 -05:00
Evan Miller
18ed616376 Kolmogorov-Smirnov distribution (#422)
* Kolmogorov-Smirnov distribution #421

Add a new distribution, kolmogorov_smirnov_distribution, which takes a
parameter that represents the number of observations used in a
Kolmogorov-Smirnov test. (The K-S test is a popular test for comparing
two CDFs, but the test statistic is not implemented here.)

This implementation includes Kolmogorov's original 1st order Taylor
expansion. There is a literature on the distribution's other
mathematical properties (higher order terms and exact version); this
literature is summarized in the main header file for anyone who may
want to expand the implementation later.

The CDF is implemented using a Jacobi theta function, and the PDF is a
hand-rolled derivative of that function. Quantiles plug the CDF and PDF
into a Newton-Raphson iteration. The mean and variance have nice
closed-form expressions, and the mode uses a dumb run-time maximizer.

This commit includes graphs, a ULP plotter for the PDF, and the usual
compilation and numerical tests. The test file is on the small side, but
it integrates the distribution from zero to infinity, and covers the
quantiles pretty well. As of now the numerical tests only verify
self-consistency (e.g. distribution moments and CDF-quantile relations),
so there's room to add some external checks.

* Implement skewness for K-S distribution [CI SKIP]

The third moment integrates nicely with the help of Apery's constant
(zeta_three). Verify the result via quadrature.

* Implement kurtosis for the K-S distribution

Verify the result via quadrature.
2020-09-04 08:48:51 -04:00
Evan Miller
d7141cd353 Jacobi Theta functions (#394)
* Jacobi Theta functions

Implementations, tests, and ULP plotting programs are provided for the
four Jacobi Theta functions per #373. Twenty-four public C++ functions
are provided in all, covering various precision-preserving scenarios.

Documentation for collaborators is provided in the code comments. Proper
documentation for end users will be provided when the implementation and
APIs are finalized.

Some tests are failing; this implementation is meant to start a
conversation. The core dilemma faced by the author was that large values
of |q| resulted in slow convergence, and sometimes wildly inaccurate
results. Following the implementation note in DLMF 20.14, I added code
to switch over to the imaginary versions of the theta functions when |q|
> 0.85.  This restored accuracy such that all of the identity tests
passed for a loose-enough epsilon, but then lost precision to the point
that the Wolfram Alpha spot checks failed. It is the author's hope that
someone with floating-point experience can tame the exponential dragons
and squeeze the ULPs back down to a reasonable range when |q| is large.

When #392 is merged I will add more thorough value tests, although I
fully expect them to fail until the underlying precision issues are
resolved.

As a final note, the precision issues do not affect the z=0 case - the
ULP plots indicate these return values within 2 ULP across all valid
|q|. So that's a start.

* [CI SKIP] Jacobi theta: Add special-value tests and more

* Add tests covering z=0 special values from MathWorld

* Add missing real_concept header

* Replace M_PI and friends with constants::pi etc

* Use BOOST_MATH_STD_USING in more places

* Jacobi theta: Test two more of Watson's identities [CI SKIP]

See https://mathworld.wolfram.com/JacobiThetaFunctions.html

(Equations 48 and 49)

* Improve precision of Jacobi theta functions [CI SKIP]

Rewrite the private imaginary versions to use double-sided summations
following DLMF 20.13.4 and 20.13.5. This cuts down the worst of the
precision issues by a factor of 10, and gets more of the tests to pass.

I am confident enough in the code path to eliminate the compile-time
__JACOBI_THETA_USE_IMAGINARY flag. In fact the imaginary-z code paths
are now enabled for all |q| > 0.04, i.e. most legal values of q.

More extensive tests will be needed to illuminate any remaining
precision issues.

* Jacobi theta: Make changes suggested in #394 [CI SKIP]

* Add LICENSE notice to main file

* Document convergence criteria

* Eliminate eps*eps = 0 logic. This causes some disagreement with the
zero returned by Wolfram Alpha for z=0, q > 0.99 in the fourth function.
Mathematically, the fourth function is never exactly zero, so I don't
trust Wolfram here.

* Per code-review comments, remove multiplications by floating-point 2.

* Tweak the plotting programs to display their titles, and to uniformly
use `float` as their CoarseType and `long double` as their
`PreciseType`.

* Add quadrature tests to Jacobi theta functions [CI SKIP]

The quadrature tests revealed a problem in the m1 functions: they too
should switch to the _IMAGINARY logic for q > exp(-pi), or will suffer
from slow convergence. Fix them.

Also tighten tolerances for many tests from sqrt(eps) to 100 * eps.

* Test Jacobi thetas against elliptic functions and elliptic integrals [CI SKIP]

See:

* https://dlmf.nist.gov/22.2
* https://dlmf.nist.gov/20.9#i

* Test Jacobi Thetas against their Laplace transforms [CI SKIP]

See:

* https://dlmf.nist.gov/20.10#ii

I did find some disagreement, and dropped the negative sign from the
theta1 equation. DLMF's theta2 and theta3 Laplace transform equations do
not agree at all with the computed values - will need to investigate.

In the meantime, the two implemented equations agree to 4 EPS so I am
keeping them.

* Add a note on using log1p with Jacobi theta functions [CI SKIP]

See discussion:

* https://github.com/boostorg/math/pull/394#issuecomment-655871762

* Add random data tests to Jacobi Theta functions [CI SKIP]

Add a test data generator program for the Jacobi theta functions.
This program will produce data for the tau parameterization, so that
precision isn't lost during the log-transformation. This distinguishes
it from the Wolfram Alpha data, which is parameterized by q.

A few of these new random-data tests are failing, but not by obscene
margins (< 100 EPS). These failures will be addressed when the test
tolerances are finalized.

* Add small-tau tests and simplify Jacobi Theta code [CI SKIP]

Add tests for small tau (i.e. large q). The tests are failing with mean
~ 200 EPS and max ~ 800 EPS. These look like worst-case input, and
should be the focus of future accuracy improvements.

This commit also simplifies the _IMAGINARY code by abstracting all of
the loops into a single svelte function.

* Add user documentation for Jacobi Theta functions [CI SKIP]

* Add function graphs to Jacobi Theta docs [CI SKIP]

* Define Jacobi Theta test tolerances [CI SKIP]

* Add implementation note on Jacobi theta functions [CI SKIP]

* Consolidate Jacobi Theta ULPs plotting programs [CI SKIP]

* Fix q domain checking of jacobi_theta4 [CI SKIP]

* Add ULPs plots to Jacobi Theta docs [CI SKIP]

Also add the built HTML files for easy evaluation. A full rebuild is
needed for the new docs to appear in the indexes.

* Add missing Jacobi Theta ULPs plots [CI SKIP]

* Add LaTeX source for Jacobi Theta equations [CI SKIP]

* Remove unused Jacobi Theta PNG equations [CI SKIP]

* Add Jacobi Theta performance script [CI SKIP]

Provided by @NAThompson.

* Remove vestigial eps*eps check from jacobi_theta3 [CI SKIP]

* Update Jacobi Theta docs per code review comments [CI SKIP]

* Enable arg promotion for Jacobi Theta functions [CI SKIP]

Add Jacobi theta functions to the instantiation tests and fix up
everything needed to make them pass. This changes the function
signatures to use promote_args.

* Fix Jacobi Theta plotting script [CI SKIP]

This script broke when the promote_args API was added.

* Change Jacobi Theta convergence criterion [CI SKIP]

Compare the non-oscillating part of the delta to the previous one.
This avoids some headaches comparing the delta to the partial sum,
because the partial sum can be a small number due to the oscillating
component alternating signs.

Because successive terms involve either q^n^2 or exp(-(pi*n)^2),
convergence should still happen pretty quickly. Graphs have been updated
and tests still passs with no noticeable difference.
2020-08-15 18:51:47 -04:00
Nick
1186f1a7ff rsqrt (#361)
* rsqrt

* Link docs into math.qbk. [CI SKIP]

* Demo performance with a compiler that generates good instructions [CI SKIP]
2020-05-30 22:34:56 -04:00
Nick
9a45e6a358 AGM 2020-05-29 21:50:25 -04:00
Nick
c59659f4ed Reinch's modification to Clenshaw recurrence (#339)
* Reinch's modification to Clenshaw recurrence. [CI SKIP]

* Convert Chebyshev tests to math_unit_test.hpp

* Performance of translated Chebyshev Clenshaw recurrence. [CI SKIP]

* Prepare to use modified Clenshaw recurrence in Chebyshev transform.

* Remove unused headers from Chebyshev transform test [CI SKIP]

* Update Chebyshev transform tests to use math_unit_test.hpp
2020-04-25 09:01:05 -04:00
Nick
58561d7f92 Add 2 Daubechies graphs to documentation. 2020-03-26 05:39:10 -04:00
Nick
9ba1ce6f00 Improve docs and loosen tolerances for Windows. 2020-03-23 07:39:57 -04:00
Nick
2c85c98982 Document wavelet transform. Submit (mildly) failing unit test for transforms. [CI SKIP] 2020-03-22 20:15:10 -04:00
NAThompson
38b8f5a96a Remove bug in quintic_hermite interpolation. Add graph to exhibit its utility. 2020-01-27 13:35:14 +08:00
jzmaddock
6d900c436c Merge pull request #302 from boostorg/no_mpl_dispatching
Remove dispatching via mpl and stick to boost::integral_constant.
2020-01-14 09:38:53 +00:00
jzmaddock
1e0179c883 Remove dispatching via mpl and stick to boost::integral_constant.
Simplify the dispatching logic to use mpl::if_ and broken compiler workarounds less often.
Fixes: https://github.com/boostorg/type_traits/issues/133.
2020-01-13 15:14:48 +00:00
NAThompson
d7079597c0 PCHIP: Reproduce figure 5a of Fritsch and Carlson. [CI SKIP] 2020-01-09 15:42:13 -05:00
Nick Thompson
e4c4f6db94 Makima spline: First build. 2020-01-05 17:42:17 -05:00
Nick
e5f019c62a Merge branch 'develop' into distribution_entropy 2019-12-27 14:05:19 -05:00
Brian Wignall
3c976e5e09 Fix typos 2019-12-24 21:42:09 -05:00
NAThompson
9505fe70e7 Merge branch 'develop' into distribution_entropy 2019-12-23 16:07:48 -05:00
NAThompson
20f553d37c Document entropy. Add entropy of gamma distribution. [CI SKIP] 2019-12-23 13:59:49 -05:00
Brian Wignall
df17d11299 Fix more typos, via latest version of typochecker tool 2019-12-20 10:41:42 -05:00
Brian Wignall
54770599d5 Fix more typos 2019-12-16 13:35:48 -05:00
NAThompson
c94557d1f5 Documentation and R^2. 2019-10-20 14:32:30 -04:00
Nick Thompson
b8044215e0 Merge branch 'develop' into runs_test [CI SKIP] 2019-10-13 21:19:57 -04:00
Nick Thompson
ca233a7ea0 Runs test [CI SKIP] 2019-10-13 21:17:14 -04:00
Nick
703d7f13be Ljung-Box: Change definition of test statistic to demonstrate mean-removal. 2019-10-11 11:25:38 -04:00
NAThompson
a417d206da Ljung-Box: Documentation [CI SKIP] 2019-10-10 15:34:36 -04:00
Nick
332b5b1679 One-sample t-test: Rearrangement of directory structure. 2019-10-06 14:59:28 -04:00
NAThompson
f9593b0990 Anderson-Darling: Clarify definition via contrasting to the NIST definition. 2019-10-05 14:15:42 -04:00
NAThompson
2b4070b501 Anderson-Darling: Add documentation and kick off build. 2019-09-28 17:20:06 -04:00
Nick
ee555a0738 Empirical Cumulative Distribution function 2019-09-24 11:00:07 -04:00
Nick
72a66b109a Support integer distributions. 2019-09-24 10:11:58 -04:00
Nick
2bb436b821 Fix up graph 2019-09-24 09:47:50 -04:00
Nick
3a349bf2da Empirical cumulative distribution function. 2019-09-24 09:44:16 -04:00
pabristow
22cdedec01 Merge branch 'compilance' into develop 2019-08-29 14:31:20 +01:00
NAThompson
1f0c1bb8dc Documentation for Jacobi polynomials. 2019-08-28 16:21:03 -04:00
Nick
b543139d3a Merge pull request #233 from boostorg/gegenbauer_1
Gegenbauer polynomials
2019-08-27 07:47:58 -04:00