Fit rlmer with a RANSAC-derived initial estimator.
rlmer_ransac(
formula,
data,
K = 200L,
sub_frac = 0.5,
n_starts = 1L,
phony_threshold = 0.99,
seed = NULL,
max_tries = 5L,
...
)rlmerMod object.
passed to rlmer.
passed to ransac_lme4.
number of distinct RANSAC starts for the multi-start consensus (default 1 = single best start, the previous behaviour).
a fit is treated as phony (non-interior) when its maximum \(|\hat\rho|\) exceeds this (default 0.99).
maximum number of RANSAC re-seeds when a redescending
rho.e zero-weights the refinement into a rank-deficient
positive-weight design (Koller and Stahel 2017, Remark 2). The fit is
re-drawn and re-fitted from a fresh nonsingular start until its
positive-weight fixed-effects design is full rank, up to
max_tries (default 5); if all attempts still collapse the last
fit is returned with a warning. With a fixed seed, attempt
\(t\) uses seed + t - 1, so the first attempt is reproducible
and the retries are deterministic.
other arguments to rlmer (e.g.
rho.e, rho.b, method).
Convenience wrapper that calls ransac_lme4 to obtain
a starting value and then passes it to rlmer's
init argument.
With n_starts > 1 it runs a multi-start consensus:
rlmer is fitted from each of the n_starts best distinct
RANSAC candidate starts, and the returned fit is the
lowest-residual-scale one whose random-effects covariance is interior
(\(|\hat\rho| \le\) phony_threshold). This samples several
basins of a redescending \(\psi\) and so recovers the interior
solution when the single best start happens to fall into the phony
\(|\hat\rho| \to 1\) attractor. If every start lands phony, the
best-scoring fit is returned with a warning. The per-start summary is
attached as attr(fit, "consensus").
The nonsingular subsample guarantees a full-rank fixed-effects design
at the start only; a redescending \(\psi\) can zero-weight
observations during the refinement and collapse the positive-weight
design to rank-deficiency (Koller and Stahel 2017, Remark 2). After the
fit converges its e-side robustness weights are inspected and a warning
is issued if the design restricted to the positively-weighted
observations is rank-deficient, suggesting a positive-weight
\(\psi\) (e.g. rho.e = smoothPsi) or a different start.
# \donttest{
fit <- rlmer_ransac(Reaction ~ Days + (Days | Subject),
data = sleepstudy, K = 30)
# }
Run the code above in your browser using DataLab