Skip to content

leuk example uses poisson_log but does not use log rate #114

Description

@paciorek

It looks like the use of poisson_log is incorrect, because the expression used (see below) is for the Poisson rate not the Poisson log rate.

Y[i, j] * exp(beta * Z[i]) * dL0[j]  # this is Poisson rate, but used as log rate

In non-deprecated Stan code, the revised code would be:

target += poisson_lpmf(dN[i, j] | Y[i, j] * exp(beta * Z[i]) * dL0[j]);

Or perhaps a sampling statement is cleaner:

dN[i, j] ~ poisson(Y[i, j] * exp(beta * Z[i]) * dL0[j]);

Activity

  1. bob-carpenter commented on Jul 20, 2017

    @bob-carpenter
    Member

    Thanks much for reporting. We really need to bring all of our old programs up to current standards.

    I'd be inclined to use a vectorized sampling statement to make it

    dN[i] ~ poisson_log(log_Y[i] + beta * Z[i] + log_dL0);
    

    assuming all the other types are compatible. That assumes log(Y) is defined as log_Y and same for dL0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions