
Fast Weighted Identity-Link Binomial Regression, Estimate Only (C++ Backend)
Source:R/RcppExports.R
fast_identity_binomial_regression_weighted_cpp.RdFits the same identity-link (risk-difference) binomial regression as
fast_identity_binomial_regression_cpp (see that page for the
full model, boundary-constrained IRLS line search, and interpretation), with
each observation's contribution to the log-likelihood and IRLS working
weights multiplied by a nonnegative row weight weights_r[i]. Setting
all weights to 1 recovers fast_identity_binomial_regression_cpp
exactly; this is the backend used when the identity-link model must be fit on
bootstrap-reweighted or otherwise weighted data.
Usage
fast_identity_binomial_regression_weighted_cpp(
X,
y_r,
weights_r,
maxit = 100L,
tol = 1e-06,
fixed_idx = NULL,
fixed_values = NULL,
warm_start_beta = NULL,
smart_cold_start = TRUE,
warm_start_weights = NULL,
warm_start_fisher_info = NULL,
estimate_only = FALSE
)Arguments
- X
A numeric matrix of predictors, \(n \times p\).
- y_r
A binary (0/1) numeric vector of responses, length \(n\).
- weights_r
A nonnegative numeric vector of length \(n\) giving each row's weight.
- maxit
Maximum number of Fisher-scoring iterations.
- tol
Convergence tolerance.
- fixed_idx
Optional integer indices of coefficients to hold fixed rather than estimate.
- fixed_values
Optional values to fix the parameters named by
fixed_idxat.- warm_start_beta
Optional starting values for coefficients. If provided,
smart_cold_startis ignored.- warm_start_weights
Optional initial working weights for the first IRLS iteration.
- warm_start_fisher_info
Optional initial Fisher Information matrix for the first IRLS iteration.
Value
A list with the same components as
fast_identity_binomial_regression_cpp: b,
mu_hat, working_weights, iterations, converged,
and fisher_information (all reflecting the weighted log-likelihood).
See also
fast_identity_binomial_regression_cpp for the
unweighted model and full documentation;
fast_identity_binomial_regression_with_var_cpp for the
(unweighted) variance-augmented variant.