Construct a binomial GLM family whose core link and deviance helpers are implemented in R so they work with MLX arrays as well as base R vectors. This avoids calling into compiled C routines that only handle base types.
Arguments
- link
a specification for the model link function. This can be a name/expression, a literal character string, a length-one character vector, or an object of class
"link-glm"(such as generated bymake.link) provided it is not specified via one of the standard names given next.The
gaussianfamily accepts the links (as names)identity,logandinverse; thebinomialfamily the linkslogit,probit,cauchit, (corresponding to logistic, normal and Cauchy CDFs respectively)logandcloglog(complementary log-log); theGammafamily the linksinverse,identityandlog; thepoissonfamily the linkslog,identity, andsqrt; and theinverse.gaussianfamily the links1/mu^2,inverse,identityandlog.The
quasifamily accepts the linkslogit,probit,cloglog,identity,inverse,log,1/mu^2andsqrt, and the functionpowercan be used to create a power link function.
Value
A family object compatible with stats::glm() and mlxs_glm().
Details
Currently the logit, log, cloglog, and cauchit links are supported.
For other link specifications, fall back to stats::binomial().