Giter Club home page Giter Club logo

Comments (5)

bob-carpenter avatar bob-carpenter commented on June 11, 2024

Updates to the manual should go with the PR that adds the new functions. We need to be checking that in code review in stan-dev/stan.

If the new functions have already been merged, then we'll have to do this through a separate PR. If they haven't been merged, then the manual updates shold be part of the PR for adding the function.

from docs.

spinkney avatar spinkney commented on June 11, 2024

Can we get log_mix updated? I didn't even know that this was updated until a few days ago!

There's possibly some confusion (at least on my end) about how the manual specifies the erroneous attempt to vectorize mixtures with this "vectorized" implementation that I would like cleared up.

from docs.

bob-carpenter avatar bob-carpenter commented on June 11, 2024

I'm not even sure what the signature is here. I'm tagging @WardBrian who's been cleaning up all of our doc and should be able to figure out from the OCaml code what exactly is supported in the way of signatures.

I've used shorthand to describe complicated signatures, like reals to denote scalars or 1D containers.

And yes, rewriting examples in the doc that use log_sum_exp using log_mix would be great.

from docs.

andrjohns avatar andrjohns commented on June 11, 2024

Sorry, this was one that I should have done a long time ago. If it's helpful, an example of the usage is in the example models repo here: https://github.com/stan-dev/example-models/blob/master/basic_estimators/normal_mixture_k.stan

Also, some discussion of the usage/syntax are in these comment threads from the original PRs:

from docs.

WardBrian avatar WardBrian commented on June 11, 2024

The supported signatures in stanc3 are:

log_mix(real, real, real) => real
log_mix(vector, vector) => real
log_mix(vector, row_vector) => real
log_mix(vector, array[] real) => real
log_mix(vector, array[] vector) => real
log_mix(vector, array[] row_vector) => real
log_mix(row_vector, vector) => real
log_mix(row_vector, row_vector) => real
log_mix(row_vector, array[] real) => real
log_mix(row_vector, array[] vector) => real
log_mix(row_vector, array[] row_vector) => real
log_mix(array[] real, vector) => real
log_mix(array[] real, row_vector) => real
log_mix(array[] real, array[] real) => real
log_mix(array[] real, array[] vector) => real
log_mix(array[] real, array[] row_vector) => real

I think the standard we use is to list the original function and then use the R/T syntax to list vectorized options, see e.g. https://mc-stan.org/docs/2_28/functions-reference/betafun.html

Though functions like beta seem to be much more vectorized than log_mix is. Here are all it's valid signatures in stanc3:

https://gist.github.com/WardBrian/0498ea88312fed7de4a3eaa439e6ec2c

from docs.

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.