Skip to content

History / Linear and logistic regression

Revisions

  • Add Linear and logistic regression: OLS, binomial and multinomial logit with the matrix functions, and where a nested logit fits The matrix functions matr_mul, matr_var and matr_inv had reference pages but nothing that showed what they are for. The new page builds three estimators from them and explains the layout tricks that make it work: a union_data of the regressors is the transposed data matrix, a lookup with swapped coordinates transposes it, and a vector and a one-column matrix are relabels of each other. Newton-Raphson steps for the two logit models run in an iterate loop with a template whose currValue/nextValue are the coefficient attribute. The page ends with the nested logit: the probability computation as a runnable fragment (nest domain, inclusive value, two-level probabilities), and the two estimation routes, sequential and full-information with the BHHH matrix as matr_var of the score matrix. Mixed logit, elasticities and the specification variations (choice sets per actor, sampling of alternatives, aggregate counts, alternative-specific coefficients) are placed as remarks. Linked from Matrix functions, Logit regression (whose example section was a stub), Configuration examples, and the see-also of the three matr_ pages. Verified: all four code blocks were extracted from the page as written and run with GeoDmsRun (build of GeoDMS 20.19); the coefficients, standard errors, R2, log-likelihoods and shares in the tables agree with a numpy reference to all printed digits, the nested probabilities sum to one per actor and equal the multinomial ones at lambda = 1. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

    @MaartenHilferink MaartenHilferink committed Sep 3, 2026