stan-dev / stan-dev/stan

Include (unconstrained) parameter names along with the inverse metric?

Open
#3,398 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue i/o interface
Dominant language
C++
Stars
2.8k
Forks
388
Avg merge
2d 17h
Merged PRs (30d)
15

Description

CmdStan writes the inverse metric to a file, but it doesn't include the names of the unconstrained parameters corresponding to the rows/columns. See stan-dev/cmdstanr#716.

To do that I think it would just involve including the names returned by

  model.unconstrained_param_names(names, false, false);

in the JSON file, right? For example,

  {
    "stepsize": 0.1,
    "metric_type": "diag_e",
    "unconstrained_param_names": ["alpha", "beta.1", "beta.2"],
    "inv_metric": [0.1, 0.2, 0.3]
  }

This would make it much easier for users to figure out which unconstrained parameter elements correspond to which elements of the matrix.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the code that writes the inverse metric JSON and inspect how model.unconstrained_param_names(names, false, false) is used. Add the parameter-name list alongside inv_metric, then verify the generated JSON matches the requested structure and update or run the relevant output tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.