absMoments | R Documentation |
Computes absolute moments of the standard normal, standardized GED, and standardized skew Student-t distributions.
absMoments(n, density = c("dnorm", "dged", "dstd"), ...)
n |
the order of the absolute moment, can be a vector to compute several absolute moments at once. |
density |
a character string naming a symmetric density function. |
... |
parameters passed to the density function. |
absMoments
returns a numeric vector of length n
with the
values of the absolute moments, as specified by n
, of the
selected probability density function (pdf).
If density
names one of the densities in the signature of
absMoments
, the moments are calculated from known
formulas.
Otherwise, numerical integration is used and an attribute is attached to the results to report an estimate of the error. Note that the density is assumed symmetric wihtout a check.
a numeric vector
Diethelm Wuertz for the Rmetrics R-port
Fernandez C., Steel M.F.J. (2000); On Bayesian Modelling of Fat Tails and Skewness, Preprint, 31 pages.
ged
,
std
## absMoment -
absMoments(1, "dstd", nu = 6)
absMoments(1, "dstd", nu = 600)
absMoments(1, "dstd", nu = 60000)
absMoments(1, "dstd", nu = 600000)
absMoments(1, "dnorm")
## excess kurtosis of t_nu is 6/(nu - 4)
nu <- 6
absMoments(2*2, "dstd", nu = nu) / absMoments(2*1, "dstd", nu = nu)^2 - 3
6/(nu-4)
## 4th moment for t_4 is infinite
absMoments(4, "dstd", nu = 4)
absMoments(1, "dged", nu = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.