| pk2pk {FatTailsR} | R Documentation |
Global Conversion Function Between Kiener Distribution Parameters
Description
A conversion function between Kiener distribution parameters
K1(m, g, k), K2(m, g, a, w),
K3(m, g, k, d) and K4(m, g, k, e) to and from
coefk = c(m, g, a, k, w, d, e) extracted from regkienerLX
and paramkienerX.
Usage
pk2pk(coefk, model = "K2", to = "K7", dgts = NULL)
Arguments
coefk |
vectors of numeric of length 3, 4 or 7. |
model |
character. Either "K1", "K2", "K3", "K4", "K7". |
to |
character. Either "K1", "K2", "K3", "K4", "K7". |
dgts |
integer. The rounding applied to the output. |
Details
Kiener distributions use the following parameters, some of them being redundant.
See also aw2k for the formulas and
the conversion between parameters:
-
m(mu) is the median of the distribution,. -
g(gamma) is the scale parameter. -
a(alpha) is the left tail parameter. -
k(kappa) is the harmonic mean ofaandwand describes a global tail parameter. -
w(omega) is the right tail parameter. -
d(delta) is the distortion parameter. -
e(epsilon) is the eccentricity parameter.
pk2pk() performs the conversion between the various representation, from and to:
"K1" :
kiener1(m, g, k)"K2" :
kiener2(m, g, a, w)"K3" :
kiener3(m, g, k, d)"K4" :
kiener4(m, g, k, e)"K7" :
c(m, g, a, k, w, d, e)
coefk can take any of the above form. When length(coefk) is 4,
model = "K2", "K3" or "K4" is required to differentiate the three models.
When length(coefk) is 3 or 7, recognition is automatic and
model = "K1" or "K7" is ignored. The vector is assumed to be correct
and there is no check of the consistency between the
parameters a, k, w, d and e.
The output may be any of the above forms. Default is "K7" = c(m, g, a, k, w, d, e)
which is coefk provided by the regression function regkienerLX
or the parameter estimation function paramkienerX. It is widely in many plots.
An integer rounding parameter is provided trough dgts. Default is no rounding.
See Also
Local conversion functions aw2k,
Kiener distributions K1, K2, K3 and K4: kiener1,
kiener2, kiener3, kiener4
Examples
## Example 1
c2 <- c(1, 2, 3, 5)
pk2pk(c2, model = "K2", to = "K1") # loose the asymmetry.
pk2pk(c2, model = "K2", to = "K2")
pk2pk(c2, model = "K2", to = "K3")
pk2pk(c2, model = "K2", to = "K4")
pk2pk(c2, model = "K2", to = "K4")
(c7 <- pk2pk(c2, model = "K2", to = "K7", dgts = 3))
pk2pk(c7, model = "K7", to = "K2")
## Example 2 ("K2" to "K7")
(mat4 <- matrix( c(rep(0,9), rep(1,9), seq(0.5,4.5,0.5), seq(1,5,0.5)),
nrow = 4, byrow = TRUE, dimnames = list(c("m","g","a","w"), paste0("b",1:9))))
(mat7 <- round(apply(mat4, 2, pk2pk), 3))