-
Notifications
You must be signed in to change notification settings - Fork 25
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
[Feature Request] Increase parallels between tidy.brmsfit
and tidy.stanreg
?
#156
Comments
This seems like a perfectly reasonable (although breaking backward compatibility). For the places where one platform's tidy-output doesn't obviously dominate the other (e.g. we presumably want to have Any chance of a pull request ... ?? |
I would normally agree to do a pull-request, but I am unfortunately far past my max bandwidth and really shouldn't agree to anything. Sorry. My memory is that In my opinion, tidy should be consistent with the original package's intent, so then I think we should keep Although, if it were up to me, they would both default to the robust estimates. For context, I'm developing a Monte Carlo sim comparing rstanarm/brms to lmer--when used with as many default settings as possible--and what I found is that the non-robust estimates can sometimes be beyond completely absurd. If I were to request an early christmas gift, we'd also get the bulk and tail ESS of the parameter estimates. |
Though... If I were to make a pull-request should I adjust the rstanarm tidy function to still depend on |
So I don't know enough about HMC or Bayes to know if this is a problem, but EDIT: Given that I assume that this is due to differences in the parameterization of the random parameter between |
I wouldn't necessarily assume that. Haven't dug into this/thought about this carefully, but a lot of the machinery of these two methods may have been contributed by others/stolen from other places, so inconsistencies might be entirely accidental ... FWIW |
Oh I think there may be a mis-understanding, maybe, what I'm guessing is happening is that in brms, the stan code is such that you get the draws of the standard deviation of the random effects directly. However, in rstanarm, the draws are some pre-cursor to the standard deviation of the random effects. That's what I mean by differences in parameterization. Regardless, I understand wanting to work with So I'm confused... |
I absolutely agree that using package-specific accessors wherever possible is the best practice. This is why it might be nice to request a sumfun <- if (robust) median else mean
scols <- grepl("^Sigma\\[", colnames(mat))
Sigma <- apply(mat[,scols, drop = FALSE], 1, sumfun) There would be a tiny performance cost using scols <- grepl("^Sigma\\[", colnames(mat))
if (robust) {
Sigma <- apply(mat[,scols, drop = FALSE], 1, median)
} else {
Sigma <- colMeans(mat[,scols, drop = FALSE])
} if preferred ... |
Hold on now though, but doesn't your one-liner require that we apply it on the draws? I thought you said you were against applying it on the draws. 😅 Well either way, the one-liner alone won't make |
The code I showed is based on the |
It would be a really nice and appreciated feature if the
tidy.brmsfit
andtidy.stanreg
functions had overlapping arguments and functionality.Some notable differences are:
tidy.brmsfit
uses non-robust estimates by default, whereastidy.stanreg
uses the robust estimatetidy.stanreg
doesn't seem to allow the extraction ofrhat
andess
for each parameter, whereastidy.brmsfit
doestidy.brmsfit
reports the standard errors and confidence intervals for all parameters. Yet fortidy.stanreg
, they seem to be missing for random effects for some reason that I haven't been able to figure out.rstanarm
problem with what it's storing inses
tidy.brmsfit
's documentation says that you can get "ran_vals", but the default-arguments/documentation of usage implies that it's only fixed or random parametersHere is a reprex of the differences
Created on 2024-11-15 with reprex v2.1.1
The text was updated successfully, but these errors were encountered: