Giter VIP home page Giter VIP logo

Comments (9)

paul-buerkner avatar paul-buerkner commented on August 23, 2024

I agree but how would their treatment be different?

from posterior.

MansMeg avatar MansMeg commented on August 23, 2024

You cant use mean, rhat or sd for example.

We would probably need to define ordered and non-ordered representations.

I actually dont know how to summarize them in a good way?

from posterior.

paul-buerkner avatar paul-buerkner commented on August 23, 2024

I see. At least anything that has more than 2 unordered values will be a problem.
Summarizing them would come down to making a table of their values mostly I think.

For ordered ones, median etc. would still be useful.

I agree this is something worth considering and it certainly requires some thought of how to do this correctly.

from posterior.

MansMeg avatar MansMeg commented on August 23, 2024

Indeed. I guess that we may be a little blind by the stan limitations here. I think a posterior package should at least don't break using discrete parameters.

from posterior.

paul-buerkner avatar paul-buerkner commented on August 23, 2024

Does anybody know how other packages handle those?

from posterior.

MansMeg avatar MansMeg commented on August 23, 2024

I do not know. I know JAGS has discrete parameters.

from posterior.

jgabry avatar jgabry commented on August 23, 2024

@MansMeg Thanks for raising this issue. This is definitely something we should think about.

Maybe the easiest thing to do for now is to just to include discrete parameters like all others but print a message if we detect a discrete parameter that certain summaries/diagnostics do not apply? I'm certainly open to other options though!

from posterior.

mjskay avatar mjskay commented on August 23, 2024

Some thoughts here:

  • from what I remember of JAGS (it's been a few years) it just uses integers for discrete parameters. That seems fine enough for most use cases. The only case where it is annoying is if those integers actually correspond to something meaningful, like factor levels in the original data.
  • in some cases tidybayes will give you back factors if there's enough information from the model to do it. E.g. if you use add_predicted_draws on an ordinal regression from brms you will get factors (you could have, for example, a long-format data frame with a factor column representing posterior predictions). This can be very useful in summarizing predictions or creating visualizations, particularly because manually mapping integers back onto levels may be error prone.

If we wanted to support factors life can get complicated for some formats: e.g., I think matrices of factors break in some corner cases. Other formats, like lists and tibbles, should be fine. As I've been experimenting with rv-style formats (#8), one potential advantage of some ways of structuring it is that you can construct distributions over arbitrary objects. This makes it less efficient in some cases but could be a way to allow that flexibility (traded off against efficiency) if someone wants it.

So I guess one question is, do we want to support something (e.g. samples of factors) that can only really be represented in some formats and not others?

from posterior.

paul-buerkner avatar paul-buerkner commented on August 23, 2024

I think supporting importants things only in certain formats is fine, and I would consider discrete variables to be one of those important things. We need to find an efficient way to detect their presense and then throw an error if an attempt is made to convert to a format which doesn't support them, but that should be no problem.

from posterior.

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.