Title: | Raw, Central and Standardized Moments of Parametric Distributions |
---|---|
Description: | To calculate the raw, central and standardized moments from distribution parameters. To solve the distribution parameters based on user-provided mean, standard deviation, skewness and kurtosis. Normal, skew-normal, skew-t and Tukey g-&-h distributions are supported, for now. |
Authors: | Tingting Zhan [aut, cre, cph] |
Maintainer: | Tingting Zhan <[email protected]> |
License: | GPL-2 |
Version: | 0.1.2 |
Built: | 2024-10-31 22:24:28 UTC |
Source: | CRAN |
-&-
DistributionMoments of Tukey -&-
distribution.
moment_GH(A = 0, B = 1, g = 0, h = 0)
moment_GH(A = 0, B = 1, g = 0, h = 0)
A |
|
B |
|
g |
|
h |
Function moment_GH returns a moment object.
Raw moments of Tukey -&-
distribution: doi:10.1002/9781118150702.ch11
A = 3; B = 1.5; g = .7; h = .01 moment_GH(A = A, B = B, g = 0, h = h) moment_GH(A = A, B = B, g = g, h = 0) moment_GH(A = A, B = B, g = g, h = h)
A = 3; B = 1.5; g = .7; h = .01 moment_GH(A = A, B = B, g = 0, h = h) moment_GH(A = A, B = B, g = g, h = 0) moment_GH(A = A, B = B, g = g, h = h)
Moments of normal distribution, parameter nomenclature follows dnorm function.
moment_norm(mean = 0, sd = 1)
moment_norm(mean = 0, sd = 1)
mean |
|
sd |
Function moment_norm returns a moment object.
moment_norm(mean = 1.2, sd = .7)
moment_norm(mean = 1.2, sd = .7)
Moments of skew-normal distribution, parameter nomenclature follows dsn function.
moment_sn(xi = 0, omega = 1, alpha = 0)
moment_sn(xi = 0, omega = 1, alpha = 0)
xi |
|
omega |
|
alpha |
Function moment_sn returns a moment object.
xi = 2; omega = 1.3; alpha = 3 moment_sn(xi, omega, alpha) curve(sn::dsn(x, xi = 2, omega = 1.3, alpha = 3), from = 0, to = 6)
xi = 2; omega = 1.3; alpha = 3 moment_sn(xi, omega, alpha) curve(sn::dsn(x, xi = 2, omega = 1.3, alpha = 3), from = 0, to = 6)
DistributionMoments of skew- distribution, parameter nomenclature follows
dst function.
moment_st(xi = 0, omega = 1, alpha = 0, nu = Inf)
moment_st(xi = 0, omega = 1, alpha = 0, nu = Inf)
xi |
|
omega |
|
alpha |
|
nu |
Function moment_st returns a moment object.
Raw moments of skew-: https://arxiv.org/abs/0911.2342
xi = 2; omega = 1.3; alpha = 3; nu = 6 curve(sn::dst(x, xi = xi, omega = omega, alpha = alpha, nu = nu), from = 0, to = 6) moment_st(xi, omega, alpha, nu)
xi = 2; omega = 1.3; alpha = 3; nu = 6 curve(sn::dst(x, xi = xi, omega = omega, alpha = alpha, nu = nu), from = 0, to = 6) moment_st(xi, omega, alpha, nu)
Up to 4th raw , central
and
standardized moments
of the random variable
Also, the mean, standard deviation, skewness and excess kurtosis of the random variable .
For ,
let
, then, according to
Binomial theorem,
the 2nd to 4th central moments of
are,
The distribution characteristics of are,
The distribution characteristics of are
,
,
, and
.
distname
character scalar, name of distribution,
e.g., 'norm'
for normal, 'sn'
for skew-normal, 'st'
for skew-,
and
'GH'
for Tukey -&-
distribution,
following the nomenclature of dnorm, dsn, dst and
QuantileGH::dGH
location,scale
mu
numeric scalar or vector,
1st raw moment .
Note that the 1st central moment
and
standardized moment
are both 0.
raw2,raw3,raw4
central2,central3,central4
numeric scalars or vectors,
2nd or higher central moments, and
,
standardized3,standardized4
numeric scalars or vectors,
3rd or higher standardized moments,
skewness and
kurtosis
.
Note that the 2nd standardized moment is 1
Potential name clash with function e1071::moment
.
-&-
Parameters from MomentsSolve Tukey -,
- and
-&-
distribution parameters
from mean, standard deviation, skewness and kurtosis.
moment2GH(mean = 0, sd = 1, skewness, kurtosis) moment2GH_h_demo(sd = 1, kurtosis) moment2GH_g_demo(mean = 0, sd = 1, skewness)
moment2GH(mean = 0, sd = 1, skewness, kurtosis) moment2GH_h_demo(sd = 1, kurtosis) moment2GH_g_demo(mean = 0, sd = 1, skewness)
mean |
numeric scalar, mean |
sd |
numeric scalar, standard deviation |
skewness |
numeric scalar |
kurtosis |
numeric scalar |
Function moment2GH solves the
location , scale
, skewness
and elongation
parameters of Tukey
-&-
distribution,
from user-specified mean
(default 0), standard deviation
(default 1),
skewness and kurtosis.
An educational and demonstration function moment2GH_h_demo solves
parameters of Tukey
-distribution,
from user-specified
and kurtosis.
This is a non-skewed distribution, thus
the location parameter
, and the skewness parameter
.
An educational and demonstration function moment2GH_g_demo solves
parameters of Tukey
-distribution,
from user-specified
,
and skewness.
For this distribution, the elongation parameter
.
Function moment2GH returns a length-4
numeric vector .
Function moment2GH_h_demo returns a length-2
numeric vector .
Function moment2GH_g_demo returns a length-3
numeric vector .
moment2GH(skewness = .2, kurtosis = .3) moment2GH_h_demo(kurtosis = .3) moment2GH_g_demo(skewness = .2)
moment2GH(skewness = .2, kurtosis = .3) moment2GH_h_demo(kurtosis = .3) moment2GH_g_demo(skewness = .2)
Converts multiple sets of moments to multiple sets of distribution parameters.
moment2param(distname, FUN = paste0("moment2", distname), ...)
moment2param(distname, FUN = paste0("moment2", distname), ...)
distname |
character scalar, distribution name.
Currently supported are |
FUN |
name or character scalar,
(name of) function used to solve the distribution parameters from moments.
Default is |
... |
numeric scalars,
some or all of |
Function moment2param returns a list of numeric vectors.
skw = c(.2, .5, .8) krt = c(.5, 1, 1.5) moment2param(distname = 'GH', skewness = skw, kurtosis = krt) moment2param(distname = 'st', skewness = skw, kurtosis = krt)
skw = c(.2, .5, .8) krt = c(.5, 1, 1.5) moment2param(distname = 'GH', skewness = skw, kurtosis = krt) moment2param(distname = 'st', skewness = skw, kurtosis = krt)
Solve skew-normal parameters from mean, standard deviation and skewness.
moment2sn(mean = 0, sd = 1, skewness)
moment2sn(mean = 0, sd = 1, skewness)
mean |
numeric scalar, mean |
sd |
numeric scalar, standard deviation |
skewness |
numeric scalar |
Function moment2sn solves the
location , scale
and slant
parameters
of skew-normal distribution,
from user-specified mean
(default 0), standard deviation
(default 1) and
skewness.
Function moment2sn returns a length-3
numeric vector .
moment2sn(skewness = .3)
moment2sn(skewness = .3)
Parameters from MomentsSolve skew- parameters from mean, standard deviation, skewness and kurtosis.
moment2st(mean = 0, sd = 1, skewness, kurtosis) moment2t_demo(sd = 1, kurtosis)
moment2st(mean = 0, sd = 1, skewness, kurtosis) moment2t_demo(sd = 1, kurtosis)
mean |
numeric scalar, mean |
sd |
numeric scalar, standard deviation |
skewness |
numeric scalar |
kurtosis |
numeric scalar |
Function moment2st solves the
location , scale
, slant
and degree of freedom
parameters of skew-
distribution,
from user-specified mean
(default 0), standard deviation
(default 1),
skewness and kurtosis.
An educational and demonstration function moment2t_demo solves
parameters of
-distribution,
from user-specified
and kurtosis.
This is a non-skewed distribution, thus
the location parameter
, and the slant parameter
.
Function moment2st returns a length-4 numeric vector
.
Function moment2t_demo returns a length-2
numeric vector .
moment2st(skewness = .2, kurtosis = .3) moment2t_demo(kurtosis = .3)
moment2st(skewness = .2, kurtosis = .3) moment2t_demo(kurtosis = .3)