Raw Moments of the Beta-Danish Distribution
Usage
bd_moments(r, a, b, c, k, rel.tol = 1e-10, subdivisions = 4000L)
Arguments
- r
Order or orders of the moment. Non-negative.
- a
Shape parameter (beta generator).
- b
Shape parameter governing the tail; `E(Z^r)` is finite iff `b > r`.
- c
Shape parameter (baseline).
- k
Scale parameter (baseline).
- rel.tol
Relative accuracy, passed to [stats::integrate()].
- subdivisions
Subdivision limit, passed to [stats::integrate()].
Value
A numeric vector the length of `r`. Entries with `b <= r` are `Inf`.
Details
The survival function is regularly varying with index \(-b\), so
\(E(Z^r)\) is finite if and only if \(b > r\). That condition is checked
rather than assumed: a request for a moment that does not exist returns
`Inf`, not a large finite number produced by a truncated sum.
See also
[bd_moment_summary()], [bd_incomplete_moment()]
Examples
bd_moments(1:2, a = 1.5, b = 3, c = 2, k = 1)
#> [1] 1.84375 8.87500
# The fourth moment does not exist when b = 3
bd_moments(4, a = 1.5, b = 3, c = 2, k = 1)
#> [1] Inf