Generating Function of the Moments or Cumulants
momGen.RdGenerating Function of the Moments or Cumulants.
Arguments
- object
-
An object of class
"SplineDensity". - t
-
Numeric vector of values at which the generating function will be evaluated.
- tmax
-
When
tis missing, a numerical vector of values from0.0totmaxis used. - log
-
Logical. If
TRUEthe returned value is the generating function of cumulants rather than moments.
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.
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)