Comments (8)
Thanks for pointing that out! You're right, I think this is a bad design choice. Better to stick with the return in the form of a dataframe containing the two values. Also, I've added more info about them. Will be in upcoming PR
from bayestestr.
After thinking a bit more I've decided to re-set the inclusion of the density value to optional as I think most users won't expect nor need it. I tried to document it better in the documentation.
from bayestestr.
I am still hesitating with this one... currently MAP_estimate always returns a dataframe with one or two column). However, users might expect a single value instead of a dataframe. The density value of the MAP (the possible second column) was initially added because it is used in p_map
and because it might be worth something (#59). At the same time, it can be easily retrieved using density_at
, although it is computationally not very efficient (i.e. the density function would be estimated twice).
Nevertheless, maybe it's better to harmonize it with other functions and return a single value (in case a single posterior is passed) instead of always a dataframe...
from bayestestr.
Well, you still have attributes (to save the density value), and you can add a print()
-method. What is printed (many information) and what is returned for further computation (a numeric value, with attrbiute) can be something different.
from bayestestr.
storing the density value as an attribute solves all problems. Thanks for that :)
from bayestestr.
Well I am kind of disappointed to find out that numeric cannot really take attributes... 😅 More precisely, adding attributes to a numeric make the tests fail. If I create a new class `c("MAP", "numeric"), the tests also fail... See #67
Returning a list seems a bit as going back to the dataframe behaviour 😕
from bayestestr.
You can actually check for values with attributes in tests, I have done this somewhere in on of my / our packages... I must check if I can find it...
from bayestestr.
I think this has been addressed
from bayestestr.
Related Issues (20)
- 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
- Fix CRAN note HOT 2
- Request for emmeans methods not to concatenate grouping variables into single column 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.