Skip to contents

Given a candidate vector of parameter names, check that these match a known naming rule suitable for the given model.

Usage

checkParNames(parNames, model, all = TRUE, trace = 0)

Arguments

parNames

Candidate vector of parameter names.

model

A possible Extreme-Value model. This is case-insensitive.

all

Logical. If TRUE, the vector is assumed to contain all the parameter names, possibly in a different order.

trace

Integer level of verbosity.

Value

A list with the following items

rule

The name of the identified rule for naming the parameters. For instance, "names" corresponds to the rule used in this package, "greek" corresponds using the names of the greek letters associated to the parameters.

inParNames

A copy of the vector parNames that was given on input.

parNames

The vector of names corresponding to the rule "names" hence the convention used in this package.

indIn, indOut

Vectors of integer indices relating to the conventional vector of names. indIn corresponds to the given names, possibly translated into the conventional rule. indOut corresponds to the omitted names, and can only have a positive length when all is FALSE on input.

Examples

checkParNames(parNames = c("sigma", "mu", "xi"), model = "GEV")
#> $rule
#> [1] "greek"
#> 
#> $inParNames
#> [1] "mu"    "sigma" "xi"   
#> 
#> $parNames
#> [1] "loc"   "scale" "shape"
#> 
#> $indIn
#> [1] 2 1 3
#> 
#> $indOut
#> integer(0)
#> 
#> $pos
#>    mu sigma    xi 
#>     2     1     3 
#> 
checkParNames(parNames = c("sigma", "xi"), model = "GEV", all = FALSE)
#> $rule
#> [1] "greek"
#> 
#> $inParNames
#> [1] "mu"    "sigma" "xi"   
#> 
#> $parNames
#> [1] "loc"   "scale" "shape"
#> 
#> $indIn
#> [1] 2 3
#> 
#> $indOut
#> [1] 1
#> 
#> $pos
#>    mu sigma    xi 
#>     3     1     2 
#> 
checkParNames(parNames = c("lambda", "sigma", "xi"), model = "poisgp")
#> $rule
#> [1] "greek"
#> 
#> $inParNames
#> [1] "lambda" "sigma"  "xi"    
#> 
#> $parNames
#> [1] "lambda" "scale"  "shape" 
#> 
#> $indIn
#> [1] 1 2 3
#> 
#> $indOut
#> integer(0)
#> 
#> $pos
#> lambda  sigma     xi 
#>      1      2      3 
#>