-
Notifications
You must be signed in to change notification settings - Fork 0
Stats Regression generalizedlinearmodel
github-actions[bot] edited this page Sep 21, 2026
·
21 revisions
Home › Stats-Regression › Generalized linear models
A generalized linear model, fitted by IRLS, with the whole inference table.
public static class GeneralizedLinearModelExample — a logistic fit, and the table that makes it inference.
using Lodestar.Stats.Regression;
double[] design = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0];
double[] response = [0.0, 0.0, 1.0, 0.0, 1.0, 1.0];
GlmSummary fit = GeneralizedLinearModel.Fit(design, response, 1, GlmFamily.Binomial);
double slope = fit.Coefficients[1]; // => 1.2140275858506062
double deviance = fit.Deviance; // => 4.955973670099227
bool converged = fit.Converged; // => TrueRemarks — reference behavior is statsmodels 0.15.0's GLM(...).fit(). The response is a
count or a {0, 1} outcome; for a real-valued one,
OrdinaryLeastSquares is the same table without a link.
Applies to — net10.0, netstandard2.0.
See also — GlmSummary, GlmOptions,
GlmFamily, the generalized linear model index.
| Member | What it does |
|---|---|
GeneralizedLinearModel.Fit |
Fits one model and reports its inference table. |