Skip to content

Expose log_prob and grad_log_prob methods #679

@andrjohns

Description

@andrjohns

I'm opening this as a reference issue/reminder to myself to add a log_prob method to CmdStanFit once the PR has been merged.

As for the implementation/design, I'm thinking of simply mirroring the method arguments:

mod <- cmdstan_model(...)
samp <- mod$sample(...)

log_prob_output <- samp$log_prob(constrained_pars=..., unconstrained_pars=..., jacobian_adjust=TRUE)

Where the method would simply write the constrained_pars/unconstrained_pars to a .json file and call the exe_file.

The return (log_prob_output) would the data.frame/tibble from reading in the generated csv (i.e., no formatting changes).

How does that sound? Is there any other functionality that would be needed for feature parity with rstan in this case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions