Code Monkey home page Code Monkey logo

Comments (19)

strengejacke avatar strengejacke commented on September 18, 2024 1

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.

strengejacke avatar strengejacke commented on September 18, 2024 1

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.

strengejacke avatar strengejacke commented on September 18, 2024

@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.

DominiqueMakowski avatar DominiqueMakowski commented on September 18, 2024

yes, and it applies to all the function that runs on models (hdi, rope, future ci...) right ?

from bayestestr.

strengejacke avatar strengejacke commented on September 18, 2024

yes. Affected should be hdi(), rope(), equivalence_test() and (future) ci().

from bayestestr.

rubenarslan avatar rubenarslan commented on September 18, 2024

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.

strengejacke avatar strengejacke commented on September 18, 2024

What are parameters of interest here? bsp_mexsdx, but also meanme_mex or sdme_mex ?

from bayestestr.

DominiqueMakowski avatar DominiqueMakowski commented on September 18, 2024

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.

rubenarslan avatar rubenarslan commented on September 18, 2024

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.

strengejacke avatar strengejacke commented on September 18, 2024

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.

strengejacke avatar strengejacke commented on September 18, 2024

I just realized that we could extend pars to other functions like p_rope etc. as well... @DominiqueMakowski what would you say?

from bayestestr.

DominiqueMakowski avatar DominiqueMakowski commented on September 18, 2024

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.

strengejacke avatar strengejacke commented on September 18, 2024

Yeah, we could name it parameters, I currently just used the naming convention from brms or rstanarm.

from bayestestr.

DominiqueMakowski avatar DominiqueMakowski commented on September 18, 2024

Then parameters with "See pars argument in brms and rstanarm" in the docstrings 😁 ?

from bayestestr.

strengejacke avatar strengejacke commented on September 18, 2024

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.

rubenarslan avatar rubenarslan commented on September 18, 2024

That was quick! Cheers. What is the counterpart of sjPlot::tab_model in the easyverse? Does it allow restricting parameters too now?

from bayestestr.

strengejacke avatar strengejacke commented on September 18, 2024

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.

strengejacke avatar strengejacke commented on September 18, 2024

@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.

paoloinglese avatar paoloinglese commented on September 18, 2024

Can you please update your website where you explain how to use equi_test with these additional options? Thx!

from bayestestr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.