{'fraction_non_alphanumeric': 0.015194681861348529, 'fraction_numerical': 0.0, 'mean_word_length': 5.311377245508982, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Numerical Computation of the Moments of a Probability Distribution from its Transform

We present a simple, fast, and robust algorithm for numerically computing the first N moments arbitrary N of a nonnegative probability distribution from its Laplace-Stieltjes transform continuous/mixed case or z-transform discrete case. The algorithm is based on numerically inverting an adaptively modified moment generating function. It only requires computation of the transform at several complex values of its argument. We also show that the high-order moments may be used in detecting the presence of exponential or geometric tails in distributions, and in case they are present the two parameters characterizing such a tail may be accurately computed. Several numerical examples of interest in the queueing literature illustrate the use of the algorithm. They include commonly used distributions as well as the waiting time, queue length, and busy period in queues with Poisson or more general Markovian arrival processes. Priority queues are also considered.