stan-dev / stan-dev/math

add log_Phi_approx function and its complement

Open
#1,025 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue new function
Dominant language
C++
Stars
839
Forks
220
Avg merge
2d 4h
Merged PRs (30d)
14

Description

Description

For arithmetic stability in CDF calculations, we should have an approximate Phi and its complement on the log scale.

Note

  • Ideally this will be done with custom derivatives
  • Ideally this will be properly vectorized

If not, there's a log_inv_logit that could be called.

A naming convention for complements needs to be established. logc_Phi_approx seems a bit too cryptic despite our having lcdf and lccdf functions.

Current Math Version

v2.18.0

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

Start by locating the existing Phi-related implementation and the log_inv_logit function mentioned in the issue. Clarify the complement naming convention, then determine the expected stability, custom-derivative, and vectorization requirements. Done means the approximate Phi and complement are implemented with agreed names and covered by the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.