Learn R Programming

zipfextR (version 1.0.2)

moezipfMoments: Distribution Moments.

Description

General function to compute the k-th moment of the MOEZipf distribution for any integer value \(k \geq 1\), when it exists. The k-th moment exists if and only if \(\alpha > k + 1\). For k = 1, this function returns the same value as the moezipfMean function.

Usage

moezipfMoments(k, alpha, beta, tolerance = 10^(-4))

Arguments

k

Order of the moment to compute.

alpha

Value of the \(\alpha\) parameter (\(\alpha > k + 1\)).

beta

Value of the \(\beta\) parameter (\(\beta > 0\)).

tolerance

Tolerance used in the calculations (default = \(10^{-4}\)).

Value

A positive real value corresponding to the k-th moment of the distribution.

Details

The k-th moment is computed by calculating the partial sums of the serie, and stopping when two consecutive partial sums differ less than the tolerance value. The value of the last partial sum is returned.

Examples

Run this code
# NOT RUN {
moezipfMoments(3, 4.5, 1.3)
moezipfMoments(3, 4.5, 1.3,  1*10^(-3))
# }

Run the code above in your browser using DataLab