stan-dev / stan-dev/math

more glm functions

Open
#1,964 8 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
839
Forks
220
Avg merge
2d 4h
Merged PRs (30d)
14

Description

Feature request: glms for positive continuous distributions

It would be very useful to include _glm_lpdf functions positive-only data with positively-skewed errors. (See my post here
https://discourse.mc-stan.org/t/trying-to-understand-glm-lp-f-functions-in-stan/16400/5).

In cognitive psychology and psycholinguistics, reaction (and reading) times are usually fit with a lognormal likelihood. So I think that lognormal_glm_lpdf would be for sure useful for wide audience.
A gamma distribution is also not uncommon (also for ecology, https://seananderson.ca/2014/04/08/gamma-glms/), but here there are several posibilities for a link function, inverse link, no link, log link.

Additions by @avehtari:

  • We're missing also binomial_logit_glm (requested in Stan discourse.
  • ordered_probit_glm (we have ordered_logistic_glm)

So the current wish list would be

  • lognormal
  • gamma
  • weibull
  • ordered_probit
  • binomial (added in 2.34 January 2024)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points and lists lognormal, gamma, Weibull, and ordered probit GLMs, with multiple possible links for gamma. Start by reviewing the existing GLM implementations and resolving which distribution and link combinations are in scope. Done means the selected subset has agreed behavior and coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.