Skip to contents

The lower incomplete moment \(M_r(t) = \int_0^t z^r f(z)\,dz\) and the upper incomplete moment \(\Upsilon_r(t) = \int_t^\infty z^r f(z)\,dz\).

Usage

bd_incomplete_moment(r, t, a, b, c, k, lower = TRUE, rel.tol = 1e-10)

Arguments

r

Order of the moment.

t

Vector of thresholds.

a

Shape parameter (beta generator).

b

Shape parameter governing the tail.

c

Shape parameter (baseline).

k

Scale parameter (baseline).

lower

Logical; `TRUE` (default) for \(M_r(t)\), `FALSE` for \(\Upsilon_r(t)\).

rel.tol

Passed to [stats::integrate()].

Value

A numeric vector the length of `t`.

Details

The threshold is mapped to the Beta scale by \(u_t = G(t)\), computed on the log scale so it stays accurate when \(G(t)\) approaches one, and the integral is taken over \((0, u_t)\) or \((u_t, 1)\).

See also

[bd_mrl()], [bd_lorenz()], [bd_mean_deviation()]

Examples

a <- 1.5; b <- 3; c <- 2; k <- 1
t <- 1
# The two halves sum to the complete moment
bd_incomplete_moment(1, t, a, b, c, k, lower = TRUE) +
  bd_incomplete_moment(1, t, a, b, c, k, lower = FALSE)
#> [1] 1.84375
bd_moments(1, a, b, c, k)
#> [1] 1.84375