rstanarm icon indicating copy to clipboard operation
rstanarm copied to clipboard

rstanarm does not support all link functions supported by glm{er}

Open bgoodri opened this issue 2 years ago • 0 comments

Summary:

Some link functions that are valid for glm, glmer, etc. are not supported by their stan_ counterparts

Description:

?family says for its link argument that

a specification for the model link function. This can be a name/expression, a literal character string, a length- character vector, or an object of class ‘"link-glm"’ (such as generated by ‘make.link’) provided it is not specified via one of the standard names given next ...

The rstanarm package only implements "standard" link functions for a particular family, such as "identity", "log", and "inverse" for gaussian. But gaussian(link = "cloglog") is valid with glm, glmer, etc. because gaussian calls make.link("cloglog") which is among its valid inputs:

‘"logit"’, ‘"probit"’, ‘"cauchit"’, ‘"cloglog"’, ‘"identity"’, ‘"log"’, ‘"sqrt"’, ‘"1/mu^2"’, ‘"inverse"’

Reproducible Steps:

rstanarm::stan_glm(..., family = gaussian(link = "cloglog")) # Terry Therneau pointed this out to me

RStanARM Version:

All of them have this issue, but I am using 2.26.x

R Version:

R 4.4 at least but probably all of them

Operating System:

Does not matter

bgoodri avatar Oct 28 '23 22:10 bgoodri