Skip to content

Include prior mean argument to built-in Laplace marginal likelihood functions #3202

Open
@avehtari

Description

@avehtari

Moving part of the discussion from embedded Laplace doc PR stan-dev/docs#874

From issue #3065

Going the other way, we can also provide a simplified interface where the likelihood is not user specified but set ahead of time.

target += laplace_marginal_poisson_log(theta0, *, K_fn, ...);

where * is a place-holder for arguments specific to the Poisson likelihood with a log link.

The PR for the doc has now

`y ~ ` **`laplace_marginal_poisson_log`**`(y_index, theta_init, covariance_function, (...))`

This allows using for alpha (theta) a multivariate normal prior with mean 0 and covariance defined by the covariance function. It would be great to be able to define also the mean of the normal prior as there are plenty of cases where the mean is not 0.

Thus a better function signature would be

`y ~ ` **`laplace_marginal_poisson_log`**`(y_index, theta_init, mean, covariance_function, (...))`

In theory, we could also have

`y ~ ` **`laplace_marginal_poisson_log`**`(y_index, theta_init, mean_function, (...), covariance_function, (...))`

but that doesn't improve flexibility of what can be done, potential improvement in numerical stability is small, and additional complexity in implementation is big.

The one with just a vector mean is easy as poisson_log call inside laplace_marginal_poisson_log would be just

poisson_log_lpmf(y | mean + theta)

@charlesm93, @WardBrian, @SteveBronder

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions