mirror of
https://github.com/boostorg/math.git
synced 2026-01-19 04:22:09 +00:00
119 lines
3.8 KiB
Plaintext
119 lines
3.8 KiB
Plaintext
[section:holtsmark_dist Holtsmark Distribution]
|
|
|
|
``#include <boost/math/distributions/holtsmark.hpp>``
|
|
|
|
template <class RealType = double,
|
|
class ``__Policy`` = ``__policy_class`` >
|
|
class holtsmark_distribution;
|
|
|
|
typedef holtsmark_distribution<> holtsmark;
|
|
|
|
template <class RealType, class ``__Policy``>
|
|
class holtsmark_distribution
|
|
{
|
|
public:
|
|
typedef RealType value_type;
|
|
typedef Policy policy_type;
|
|
|
|
BOOST_MATH_GPU_ENABLED holtsmark_distribution(RealType location = 0, RealType scale = 1);
|
|
|
|
BOOST_MATH_GPU_ENABLED RealType location()const;
|
|
BOOST_MATH_GPU_ENABLED RealType scale()const;
|
|
};
|
|
|
|
The [@http://en.wikipedia.org/wiki/holtsmark_distribution Holtsmark distribution]
|
|
is named after Johan Peter Holtsmark.
|
|
It is special case of a [@http://en.wikipedia.org/wiki/Stable_distribution stable distribution]
|
|
with shape parameter [alpha]=3/2, [beta]=0.
|
|
|
|
[@http://en.wikipedia.org/wiki/Probability_distribution probability distribution function PDF]
|
|
given by:
|
|
|
|
[equation holtsmark_ref1] [/f(x; \mu, c)=\frac{1}{2 \pi} \int_{-\infty}^{\infty} \exp( i t \mu - |c t|^{3/2} ) e^{-i x t} dt]
|
|
|
|
The location parameter [mu] is the location of the distribution,
|
|
while the scale parameter [c] determines the width of the distribution.
|
|
If the location is
|
|
zero, and the scale 1, then the result is a standard holtsmark
|
|
distribution.
|
|
|
|
The distribution especially used in astrophysics for modeling gravitational bodies.
|
|
|
|
The following graph shows how the distributions moves as the
|
|
location parameter changes:
|
|
|
|
[graph holtsmark_pdf1]
|
|
|
|
While the following graph shows how the shape (scale) parameter alters
|
|
the distribution:
|
|
|
|
[graph holtsmark_pdf2]
|
|
|
|
[h4 Member Functions]
|
|
|
|
BOOST_MATH_GPU_ENABLED holtsmark_distribution(RealType location = 0, RealType scale = 1);
|
|
|
|
Constructs a holtsmark distribution, with location parameter /location/
|
|
and scale parameter /scale/. When these parameters take their default
|
|
values (location = 0, scale = 1)
|
|
then the result is a Standard holtsmark Distribution.
|
|
|
|
Requires scale > 0, otherwise calls __domain_error.
|
|
|
|
BOOST_MATH_GPU_ENABLED RealType location()const;
|
|
|
|
Returns the location parameter of the distribution.
|
|
|
|
BOOST_MATH_GPU_ENABLED RealType scale()const;
|
|
|
|
Returns the scale parameter of the distribution.
|
|
|
|
[h4 Non-member Accessors]
|
|
|
|
All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
|
|
that are generic to all distributions are supported: __usual_accessors.
|
|
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
|
|
be run on both host and device.
|
|
|
|
Note however that the holtsmark distribution does not have a skewness,
|
|
kurtosis, etc. See __math_undefined
|
|
[/link math_toolkit.pol_ref.assert_undefined mathematically undefined function]
|
|
to control whether these should fail to compile with a BOOST_STATIC_ASSERTION_FAILURE,
|
|
which is the default.
|
|
|
|
Alternately, the functions __skewness, __kurtosis and __kurtosis_excess will all
|
|
return a __domain_error if called.
|
|
|
|
The domain of the random variable is \[-[max_value], +[min_value]\].
|
|
|
|
[h4 Accuracy]
|
|
|
|
The error is within 4 epsilon.
|
|
|
|
Errors in the PDF at 64-bit double precision:
|
|
|
|
[$../graphs/holtsmark_pdf_accuracy_64.png]
|
|
|
|
Errors in the CDF-complement at 64-bit double precision:
|
|
|
|
[$../graphs/holtsmark_ccdf_accuracy_64.png]
|
|
|
|
[h4 Implementation]
|
|
|
|
See references.
|
|
|
|
[h4 References]
|
|
|
|
* [@http://en.wikipedia.org/wiki/holtsmark_distribution Holtsmark Distribution]
|
|
* T. Yoshimura, Numerical Evaluation and High Precision Approximation Formula for Holtsmark Distribution,
|
|
DOI: 10.36227/techrxiv.172054657.73020014/v1, 2024.
|
|
|
|
[endsect][/section:holtsmark_dist holtsmark]
|
|
|
|
[/ holtsmark.qbk
|
|
Copyright Takuma Yoshimura 2024.
|
|
Distributed under the Boost Software License, Version 1.0.
|
|
(See accompanying file LICENSE_1_0.txt or copy at
|
|
http://www.boost.org/LICENSE_1_0.txt).
|
|
]
|