Selects the polynomial degrees for the four components of a
cnorm.shash model (\(\mu\), \(\sigma\), \(\epsilon\),
\(\delta\)) by minimizing BIC over a full grid.
autoselect.shash(
age,
score,
weights = NULL,
max_mu = 4,
max_sigma = 3,
max_epsilon = 3,
max_delta = 1,
min_mu = 1,
min_sigma = 1,
min_epsilon = 1,
min_delta = 0,
delta = 1,
control = NULL,
scale = "T",
parallel = TRUE,
n_cores = NULL,
plot = TRUE,
verbose = TRUE
)The selected fitted cnormShash model with an additional
element $selection containing:
evaluated: data frame of every combination tried, sorted by BIC.
selected: list with the chosen degrees and BIC.
Numeric vectors of predictor and response values.
Optional numeric vector of observation weights.
Maximum polynomial degrees for
the four shash parameters. Defaults: 4, 3, 3, 1.
Minimum polynomial degrees (default 1).
Minimum degree for \(\delta\). 0 (default) means
the fixed-delta variant is included in the search.
Value of \(\delta\) used whenever the candidate uses
delta_degree = 0 (i.e. fixed delta). Default 1.
Optional control list passed to optim.
Norm scale (default "T").
Logical; attempt parallel execution. Default TRUE.
Number of cores. Defaults to all logical cores.
Logical; plot the selected model. Default TRUE.
Logical; print progress. Default TRUE.
A degree of 0 for \(\delta\) is interpreted as a **fixed**
\(\delta\) (passed to cnorm.shash as delta_degree = NULL)
with value taken from the delta argument. This allows the grid
search to choose between a fixed and a varying tail-weight model.
Parallel execution is attempted by default. If the workers cannot access the cNORM namespace, the function transparently falls back to sequential execution.
cnorm.shash, autoselect.betabinomial
if (FALSE) {
m <- autoselect.shash(elfe$group, elfe$raw)
m$selection$evaluated
summary(m, age = elfe$group, score = elfe$raw)
}
Run the code above in your browser using DataLab