Skip to contents

Generating Function of the Moments or Cumulants.

Usage

momGen(object, t = NULL, tmax = 0.4, log = TRUE)

Arguments

object

An object of class "SplineDensity".

t

Numeric vector of values at which the generating function will be evaluated.

tmax

When t is missing, a numerical vector of values from 0.0 to tmax is used.

log

Logical. If TRUE the returned value is the generating function of cumulants rather than moments.

Value

A numeric vector containing the values of the generating function.

Details

The generating function is computed by using a closed form obtained by recursive integration by parts.

The generating functions \(M_X\) and \(K_X\) for the moments are defined by \(M_X(t) = \mathrm{E}[e^{tX}]\) and \(K_X(t) = \log M_X(t)\). The function \(K_X\) is increasing and convex with \(K_X(0) = 0\).

See Wikipedia's page for cumulants and that for moment generating function.

Note

The generating function of the cumulants often increases rapidly with \(t\) and take very large values unless \(t\) remains close to zero.

Author

Yves Deville

Examples

opar <- par(mfrow = c(2, 1))
ck <- rSplineDensity(order = 4, xmax = 10)
#> Warning: Recycling array of length 1 in vector-array arithmetic is deprecated.
#>   Use c() or as.vector() instead.
plot(ck, main = "spline density")
#> NULL
m <- momGen(ck, tmax = 2)
#> Ex =  4.70, Vx =  9.21

par(opar)