Comments (19)
Meanwhile, I'm not quite sure if bayestestR is affected by this issue... It gets the data from insight::get_parameters()
, and that function only returns "coefficients", i.e. parameters starting with b_
.
It actually removes probably a bit too much, since monotonic or categorical effects (starting with bsp_
and bcs_
) are also filtered out, but this is already fixed (see easystats/insight@fe8fe31).
But we could implement something like pars
anyway, in order to select specific parameters only. We should probably also think about if get_parameters()
is indeed too strict, but my impression is that the current implementation is ok - if someone wants all parameters, you still can use as.data.frame()
on the model-object.
from bayestestr.
I think we can close this now, as this option is now implemented for all functions in bayestestR. After checks have passed, I'll merge the PR.
from bayestestr.
@DominiqueMakowski We should think about addressing this issue for the initial release... It shouldn't be too hard, given that we already filter out some parameters. And in the long term, this will be handled inside insight (haha).
from bayestestr.
yes, and it applies to all the function that runs on models (hdi, rope, future ci...) right ?
from bayestestr.
yes. Affected should be hdi()
, rope()
, equivalence_test()
and (future) ci()
.
from bayestestr.
Reproducible example
library(brms)
mod <- brm(y ~ me(x, sdx), data = data.frame(y = rnorm(100), x = rnorm(100), sdx = runif(100, min = 0, 1)), cores = 4)
sjPlot::tab_model(mod)
mod <- brm(y ~ me(x, sdx), data = data.frame(y = rnorm(100), x = rnorm(100), sdx = runif(100, min = 0, 1)), cores = 4, save_mevars = TRUE)
sjPlot::tab_model(mod)
Even worse, when we turn on save_mevars = TRUE
from bayestestr.
What are parameters of interest here? bsp_mexsdx
, but also meanme_mex
or sdme_mex
?
from bayestestr.
I agree, people interested in all auxiliary parameters can just run as.data.frame(model)
and the bayestestR functions on that. Although it might be worth a small section in one vignette somewhere showing how to do that with sapply.
from bayestestr.
Please add a pars
argument – I often want to restrict a graph or table to relevant effects.
I think it would be good if the default mirrored whatever @paul-buerkner does in brms:::summary.brmsfit, maybe you can just copy that rule? In this case, we want bsp_ but not meanme oder sdme.
Oh and yes, installing bayestestR now filters out too much, but the dev release of insight fixes it.
library(brms)
#> Loading required package: Rcpp
#> Loading required package: ggplot2
#> Loading 'brms' package (version 2.7.0). Useful instructions
#> can be found by typing help('brms'). A more detailed introduction
#> to the package is available through vignette('brms_overview').
#> Run theme_set(theme_default()) to use the default bayesplot theme.
mod <- brm(y ~ me(x, sdx), data = data.frame(y = rnorm(100), x = rnorm(100), sdx = runif(100, min = 0, 1)), cores = 4)
#> Compiling the C++ model
#> Start sampling
bayestestR::hdi(mod)
#> Parameter CI CI_low CI_high
#> 1 b_Intercept 90 -0.30650765 0.04266801
#> 2 bsp_mexsdx 90 -0.08297718 0.35031090
Created on 2019-03-14 by the reprex package (v0.2.1)
from bayestestr.
Ok, I think we can make it this way... Filtering all b_
, bsp_
and bcs_
for fixed part of the model, and pars
accepts regex for further filtering.
from bayestestr.
I just realized that we could extend pars
to other functions like p_rope
etc. as well... @DominiqueMakowski what would you say?
from bayestestr.
Yes, sure, although I am not fond of the "pars" name... Wouldn't it be more consistent for the argument to be called something like parameters
?
from bayestestr.
Yeah, we could name it parameters
, I currently just used the naming convention from brms or rstanarm.
from bayestestr.
Then parameters
with "See pars
argument in brms and rstanarm" in the docstrings 😁 ?
from bayestestr.
Just to clarify: for equivalence_test()
, I would just report the fixed effects from the conditional component (i.e. no random effects nor zero-inflation part), or does it make sense to include these values in the equivalence-testing as well?
from bayestestr.
That was quick! Cheers. What is the counterpart of sjPlot::tab_model
in the easyverse? Does it allow restricting parameters too now?
from bayestestr.
No, not yet. It requires some substantial re-writing of code to implement the easyverse packages, but it's definitely a future goal.
from bayestestr.
@rubenarslan I just remembered that there are some arguments to filter parameters from the output in tab_model()
, namely terms
and rm.terms
. Were you looking for this?
from bayestestr.
Can you please update your website where you explain how to use equi_test with these additional options? Thx!
from bayestestr.
Related Issues (20)
- Missing images in BF Vignette HOT 1
- Formatting probability of direction objects fails HOT 7
- Add support for data frames with an `rvar` column HOT 4
- Be consistent with return values across functions
- P-Direction in zero-inflated models HOT 10
- error using describe_posterior HOT 3
- bayestestR broken after revising `pd()`. HOT 13
- Iris data example for Bayes Factor: with or without random effect? HOT 3
- "LogBF = Inf" problem HOT 5
- Issues with blavaan HOT 9
- Workflow badges not updating? HOT 9
- Infinite probability? HOT 2
- mediation with censored data using brm and bayestestR
- Is a directional p_rope possible? HOT 1
- hdi() fails with brms model outputs HOT 9
- CRAN submission HOT 11
- Flexible ROPE values for describe_posterior HOT 1
- Question on contr.equalprior function
- `bayesian_as_frequentist()` fails for brms `0 + Intercept` formula HOT 4
- Avoid resampling priors for `brmsfit` objects that contain prior samples HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bayestestr.