During today’s Stan Gathering I mentioned that I had locally implemented a new CmdStan method which generalizes the current generate_quantities
method. For future and current reference (@Bob_Carpenter, @mitzimorris), the method would take in addition to the “standard” arguments (id
, data
, …)
- a file containing a set of either constrained or unconstrained parameter values (currently only in non-robust binary format)
- a set of combinable boolean flags controlling the output (currently only in non-robust binary format).
These flags would enable/disable the output of
- the unconstrained parameter values,
- the constrained parameter values,
- the “transformed parameters”,
- the “generated quantities”,
- the constrained log probability density,
- the gradient of the constrained log probability density,
- the unconstrained log probability density or
- the gradient of the unconstrained log probability density.
Copying from the output of my current implementation:
compute
(Re)compute various quantities.
Valid subarguments: input_path, input_unconstrained, output_path, unconstrained_parameters, constrained_parameters, transformed_parameters, generated_quantities, constrained_log_probability, constrained_log_probability_gradient, unconstrained_log_probability, unconstrained_log_probability_gradient
input_path=<string>
(Binary) input file of (constrained) parameter values.
Valid values: Path to existing file
Defaults to
input_unconstrained=<boolean>
Input is already unconstrained.
Valid values: {0,1}
Defaults to 0
output_path=<string>
(Binary) output file of computed values.
Valid values: Writeable path
Defaults to
unconstrained_parameters=<boolean>
Compute unconstrained parameter values.
Valid values: {0,1}
Defaults to 0
constrained_parameters=<boolean>
Compute constrained parameter values.
Valid values: {0,1}
Defaults to 0
transformed_parameters=<boolean>
Compute transformed parameters.
Valid values: {0,1}
Defaults to 0
generated_quantities=<boolean>
Compute generated quantities.
Valid values: {0,1}
Defaults to 0
constrained_log_probability=<boolean>
Compute the constrained log-probability density.
Valid values: {0,1}
Defaults to 0
constrained_log_probability_gradient=<boolean>
Compute the gradient of the constrained log-probability density.
Valid values: {0,1}
Defaults to 0
unconstrained_log_probability=<boolean>
Compute the unconstrained log-probability density.
Valid values: {0,1}
Defaults to 0
unconstrained_log_probability_gradient=<boolean>
Compute the gradient of the unconstrained log-probability density.
Valid values: {0,1}
Defaults to 0
I am not married to the current interface or implementation (in which I have already found my first bug). This thread is not meant to propose to now or in the near future add the method or my implementation to Cmd/Stan. I would not recommend to anyone to use my current implementation. But, still here goes the relevant addition to the Stan services layer. I’m posting this here mainly to gauge people’s general interest in such a method.