You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The linear predictors used internally by log_lik() may differ from those derived from posterior_linpred().
Description:
While working on projpred's unit tests, I discovered an inconsistency between the linear predictors that are used internally by rstanarm:::log_lik.stanreg() and those calculated by rstanarm:::posterior_linpred.stanreg(). This might be due to some numerical instability within one of these two approaches. I stumbled across this while trying to reproduce the output of log_lik() manually (based on the linear predictors calculated by posterior_linpred()); that's why the reproducible steps shown below include the log likelihood values.
The point is that line all.equal(eta_from_linpred, eta_from_loglik_internals) shows differing linear predictors. The fact that the log likelihood values differ (line all.equal(ll_from_linpred, unname(ll))) is then clear because it's already the linear predictors which differ.
Summary:
The linear predictors used internally by
log_lik()
may differ from those derived fromposterior_linpred()
.Description:
While working on projpred's unit tests, I discovered an inconsistency between the linear predictors that are used internally by
rstanarm:::log_lik.stanreg()
and those calculated byrstanarm:::posterior_linpred.stanreg()
. This might be due to some numerical instability within one of these two approaches. I stumbled across this while trying to reproduce the output oflog_lik()
manually (based on the linear predictors calculated byposterior_linpred()
); that's why the reproducible steps shown below include the log likelihood values.Reproducible Steps:
File
rfit.rds
is provided in rfit.zip.The point is that line
all.equal(eta_from_linpred, eta_from_loglik_internals)
shows differing linear predictors. The fact that the log likelihood values differ (lineall.equal(ll_from_linpred, unname(ll))
) is then clear because it's already the linear predictors which differ.RStanARM Version:
2.26.1
R Version:
R version 4.3.1 (2023-06-16)
Operating System:
Ubuntu 22.04.3 LTS
The text was updated successfully, but these errors were encountered: