GithubHelp home page GithubHelp logo

Comments (8)

bob-carpenter avatar bob-carpenter commented on July 4, 2024

@ito4303 Would you mind looking at this?

@mikemeredith Thanks for the carefully constructed issue. Is this a problem with the BUGS code in the original book or just an issue with the translation?

I have a complete replication of Dorazio and Royle's occupancy model here:

http://mc-stan.org/documentation/case-studies/dorazio-royle-occupancy.html

I hope that's a faithful translation of their cited paper, but if not, please let me know, as I understand that model better than the BPA models. In the Dorazio and Royle approach, the result gets bounded between observed and max (pseudo-sites) because you start with the occupied ones (they're observed) then add in expected occupance of other ones, which has to be between 0 and 1. So we don't need to declare constraints to enforce the constraint.

from example-models.

mikemeredith avatar mikemeredith commented on July 4, 2024

Exceeding the constraints is a symptom, not the problem; enforcing constraints isn't the solution but is a check. The problem is that, in the call to binomial_rng, N is too big and theta is too small. That will often give a plausible result, but is still wrong.

In the BUGS code, they use a latent binary variable, z[i], for occupancy for each site, and then occ_fs = sum(z). They don't need to do the kind of posterior predictive thing. So it's an issue with the translation.

If I were really using Stan (instead of translating), I'd get the conditional (on the data) probability of occupancy for each site and sum those to get an expectation for occ_fs.

I'll look at the Dorazio et al stuff later, but what you describe is I think the right way to do it and what's needed for the BPA Ch.13 examples and the closed-capture examples in Ch.6.

from example-models.

ito4303 avatar ito4303 commented on July 4, 2024

@mikemeredith I greatly thank you for pointing out the problems. As you pointed out, they are incorrect translations.

I will contribute corrected models as soon as possible. Or, perhaps you can create pull requests with the corrected code.

from example-models.

mikemeredith avatar mikemeredith commented on July 4, 2024

@ito4303 I'll do pull requests for the models I've looked at so far. Give me a day or 2.

from example-models.

bob-carpenter avatar bob-carpenter commented on July 4, 2024

from example-models.

mikemeredith avatar mikemeredith commented on July 4, 2024

@bob-carpenter There are issues with the write-up of the Dorazio & Royle analysis, but I think the math is all ok. Where would be a good forum to discuss this?

from example-models.

bob-carpenter avatar bob-carpenter commented on July 4, 2024

from example-models.

mikemeredith avatar mikemeredith commented on July 4, 2024

@bob-carpenter I've done a pull request.

from example-models.

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.