momentIsReliable

fun momentIsReliable(j: Int, coefficients: DoubleArray, boundedness: MetalogBoundedness): Boolean(source)

Whether a numerically computed moment of the given order can be trusted to the accuracy the quadrature normally achieves.

A moment can exist and still be hard to compute. For a semi-bounded metalog the tail contribution falls off like the exponential of the tail weight less one times the logit, so as the product of moment order and tail weight approaches one, an ever larger share of the moment sits beyond the largest probability a double can represent. The moment is still finite and the returned value is still the best available estimate; it is simply less accurate. Consult this alongside the existence test when reporting a moment.