Score Function Evaluator
Use this skill to exercise BridgeStan-like score-model access on the Bernoulli recovery proxy. It consumes a Stan contract and transform adapter rather than inventing an unrelated objective.
Inputs
- Contract JSON from
stan_model_contract. - Observation data JSON with binary
yvalues. - Unconstrained scalar parameter value.
- Optional path to the transform adapter script.
Outputs
- JSON with log density, gradient, Hessian, finite-difference diagnostics, and pass/fail checks.
Workflow
- Confirm the contract contains a bounded scalar
thetaand Bernoulli likelihood. - Convert unconstrained
zto constrainedthetausing the transform adapter. - Evaluate the Bernoulli likelihood with Beta(1,1) prior and the transform Jacobian.
- Compute analytic gradient and Hessian in
z. - Cross-check the derivatives with central finite differences before accepting the result.
Validation
Run python tests/test_score_evaluator.py from this skill directory.
Limitations
This is a recovery proxy for the score-model mechanism, not a replacement for full BridgeStan compilation or real Stan autodiff.