1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Diagnostics for **binary logistic regression** — a different statistical
//! framework from OLS, not an extension of it, and provided here as its own
//! self-contained set of types.
//!
//! Logistic regression models `P(y = 1) = 1/(1 + e^{−Xβ})` and is fit by maximum
//! likelihood; there is no closed-form hat matrix and residuals are not Gaussian.
//! So the diagnostics are the ones that are actually defined for this likelihood:
//!
//! * [`LogisticFit`] — the maximum-likelihood fit via **IRLS** (Fisher scoring),
//! with coefficient standard errors, Wald `z`-statistics and p-values.
//! * [`deviance_residuals`] / [`pearson_residuals`] — the two standard residual
//! scales for a non-Gaussian GLM.
//! * [`GoodnessOfFit`] via [`LogisticFit::goodness_of_fit`] — null/residual
//! deviance, McFadden's pseudo-R², AIC/BIC, and the **Hosmer–Lemeshow** test.
//! * [`leverage`] and [`cooks_distance`] — the logistic (weighted-hat-matrix)
//! analogues of the OLS influence measures.
//!
//! # Response convention
//!
//! The response must be binary, coded `0.0` / `1.0`, with both classes present.
//! As with OLS the caller owns the design matrix, including any intercept column.
//!
//! # Separation
//!
//! When the classes are perfectly (or quasi-) separable the maximum-likelihood
//! coefficients diverge to ±∞ and no finite fit exists. IRLS then fails to
//! converge and construction returns [`RegressionError::NotConverged`](crate::RegressionError::NotConverged)
//! rather than reporting enormous, meaningless coefficients.
pub use LogisticFit;
pub use ;
pub use ;
pub use ;