pk2pk: Global Conversion Function Between Kiener Distribution...

Description Usage Arguments Details See Also Examples

View source: R/e_conversion.R

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

1
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:

pk2pk() performs the conversion between the various representation, from and to:

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## 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))

FatTailsR documentation built on March 12, 2021, 9:06 a.m.

Related to pk2pk in FatTailsR...