Quantco / glum

High performance Python GLMs with all the features!
https://glum.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
296 stars 24 forks source link

Intercept-only GLMs #380

Open lbittarello opened 3 years ago

lbittarello commented 3 years ago

It'd be nice to be able to fit GLMs without covariates. It's usually trivial, except when offsets are involved...

lbittarello commented 3 years ago

What should the interface look like? fit is pretty straightforward, but I'm not sure about predict.

QuantAkt commented 2 months ago

I found a way to phrase the obvious, which worked for me using the formula interface: formula = "Y~ {np.ones_like(Y)}", fit_intercept=True

The more obvious approach "Y~1" throws errors with "fit_intercept=True" and with "fit_intercept=False"