zipfpssMoments: Distribution Moments.

Description Usage Arguments Details Value Examples

View source: R/zipfpssMoments.R

Description

General function to compute the k-th moment of the Zipf-PSS distribution for any integer value k ≥q 1, when it exists. The k-th moment exists if and only if α > k + 1.

Usage

1
2
zipfpssMoments(k, alpha, lambda, isTruncated = FALSE,
  tolerance = 10^(-4))

Arguments

k

Order of the moment to compute.

alpha

Value of the α parameter (α > k + 1).

lambda

Value of the λ parameter (λ > 0).

isTruncated

Logical; if TRUE, the truncated version of the distribution is returned.

tolerance

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

Details

The k-th moment of the Zipf-PSS distribution is finite for α values strictly greater than k + 1. It 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.

Value

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

Examples

1
2
zipfpssMoments(1, 2.5, 2.3)
zipfpssMoments(1, 2.5, 2.3, TRUE)

zipfextR documentation built on July 8, 2020, 6:23 p.m.