TuringLang / TuringGLM.jl

Bayesian Generalized Linear models using `@formula` syntax.
https://turinglang.org/TuringGLM.jl/dev
MIT License
71 stars 7 forks source link

Modify $tau$ for GLM hierarchical models standard prior #83

Closed storopoli closed 1 year ago

storopoli commented 1 year ago

Modify tau to be std(y) instead of mad(y).

          When trying to improve a Turing hierarchical intercept logistic model by reviewing turing_model.jl, I noticed that ``` function _model(μ_X, σ_X, prior, intercept_ranef, idx, ::Type{Bernoulli})``` 

includes a normalization on the dependent variable, which here is 0/1. It gives me an error because mad(y) in my case is 0, which messes with the hyperparameter $\tau$ for SD. I thought I'd bring it to the developers' attention.

mad_y=mad(y; normalize=true) (ln 266)

Originally posted by @jfhawkin in https://github.com/TuringLang/TuringGLM.jl/issues/21#issuecomment-1496799113