n_rank_deficient_models: Number of models whose sandwich covariance is rank deficient

View source: R/model_space.R

n_rank_deficient_modelsR Documentation

Number of models whose sandwich covariance is rank deficient

Description

The robust ("sandwich") covariance H^{-1} J H^{-1} is built from J = \sum_i s_i s_i', the outer product of the entity-level score vectors. Because the per-entity scores share a component identical across entities, and because they sum to zero at the maximum, J depends only on the variation of those scores across entities. Parameters entering the log-likelihood solely through terms common to every entity contribute nothing, so J is typically of rank far below \dim(\theta) and below N, however many entities are observed.

Usage

n_rank_deficient_models(stats, n_entities = NULL, K = NULL)

Arguments

stats

Statistics matrix of a model space, whose last rows hold the dimension of the parameter vector and the rank of J for each model.

n_entities

Number of entities. Unused, retained for compatibility.

K

Number of regressors including the lagged dependent variable. When supplied, dim(theta) is read from row 4 + 2 * K and rank(J) from row 5 + 2 * K; model spaces fitted before these were stored are recognised and reported as unaffected.

Details

Where J is singular the robust standard errors of the affected directions are not identified. Those actually reported by bma, for the lagged dependent variable and the regressors, are recovered as the profile sandwich on the non-degenerate block, which is well defined; the construction nonetheless discards the score covariance involving the remaining directions.

Value

Integer, the number of models for which rank(J) is less than dim(theta). Zero if the model space does not record the rank.


badp documentation built on Aug. 20, 2026, 9:08 a.m.