Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: log link function for beta family #1316

Closed
mpirikL opened this issue Mar 13, 2022 · 5 comments
Closed

Request: log link function for beta family #1316

mpirikL opened this issue Mar 13, 2022 · 5 comments

Comments

@mpirikL
Copy link

mpirikL commented Mar 13, 2022

Can I request that the log link function be added to the beta family. I realize that this may seem like a strange request, the log link function cannot ensure that the mean is between 0 and 1. However, I have used it with rstanarm's betareg function, INLA's fitting function. And, there is some theory to back up my use of the log link function in my setting, at least in my econometric setting.

@paul-buerkner
Copy link
Owner

Yeah, I think we can do that.

@paul-buerkner paul-buerkner added this to the brms 2.16.0++ milestone Mar 13, 2022
paul-buerkner added a commit that referenced this issue Apr 7, 2022
@paul-buerkner
Copy link
Owner

Done.

@jenmunoz
Copy link

jenmunoz commented Oct 6, 2023

Hi, I am wondering if this could also by implemented for the link_phi. The reason is that when I fit a Beta model, phi= "identity" even when I specify it to be "log" in the family. e.g ( family=brmsfamily("Beta", link="logit", link_phi = "log"), phi seems to be on the identity scale and is very large! and does not actually use the log link for the phi parameter. -----------
This is the output : Family: beta
Links: mu = logit; phi = identity
Formula: mean_attentiveness_nest ~ scale(degree) + scale(elevation) + scale(mass_female_or_general) + (1 | species) + (1 | gr(species_jetz, cov = phy_cov))

@lunafazio
Copy link
Contributor

Hi @jenmunoz, it doesn't seem like you're specifying any regression on the phi parameter, so the default behavior here is to always use the identity link. If you nonetheless want to look at the parameter in the log scale, you can specify an intercept-only regression and here it will use the log link by default.

Example:

library(brms)
fit1 <- brm(bf(qsec ~ cyl), family = brmsfamily("Beta"), data = mtcars/25)
fit2 <- brm(bf(qsec ~ cyl, phi ~ 1), family = brmsfamily("Beta"), data = mtcars/25)

@jenmunoz
Copy link

jenmunoz commented Oct 7, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants