ModelConfidenceSetSelection#

class cultivars.forecast.confidence_set.ModelConfidenceSetSelection(*, names, pvalues, mean_losses, elimination_order, alpha, statistic, n_bootstrap, block_length, nobs)[source]#

The model confidence set: the forecasters not shown to be worse than the best.

Hansen, Lunde and Nason (2011): a set that contains the best model with probability at least \(1 - \alpha\), reached by eliminating the worst model while the equivalence of the remaining ones is rejected. Like a confidence interval it is honest about what the data can and cannot separate: a short or noisy evaluation window keeps many models, and that is the finding, not a failure.

Variables:
  • names (tuple[str, ...]) – Model labels, in the order the losses were given.

  • pvalues (NDArray[double]) – (M,) MCS p-values; a model is in the set at level alpha exactly when its p-value is at least alpha.

  • mean_losses (NDArray[double]) – (M,) mean loss of each model.

  • elimination_order (tuple[int, ...]) – Model indices from first eliminated to the survivor.

  • alpha (float) – Level of the set.

  • statistic (str) – "range" or "max".

  • n_bootstrap (int) – Bootstrap replications.

  • block_length (float) – Expected block length of the stationary bootstrap.

  • nobs (int) – Evaluation origins.

See also

Attributes#

names

Model labels, in the order the losses were given.

pvalues

MCS p-values, (M,); a model is in the set when its p-value is at least alpha.

mean_losses

Mean loss of each model over the evaluation origins, (M,).

elimination_order

Model indices from the first eliminated to the survivor.

alpha

Level of the set; it contains the best model with probability at least \(1 - \alpha\).

statistic

Equivalence statistic used, "range" or "max".

n_bootstrap

Bootstrap replications behind the p-values.

block_length

Expected block length of the stationary bootstrap.

nobs

Number of evaluation origins.

best

The survivor of the elimination sequence.

excluded

The models eliminated, in elimination order.

included

The models in the set, best mean loss first.

Methods#

pvalue(name)

One model's MCS p-value.

summary()

Render as a table in elimination order, survivor last.