stan-dev / stan-dev/math

Log Riemann Zeta plus Zipf distribution

Open
#28 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

From @bob-carpenter on February 12, 2014 18:9

It'd be nice to have the Zipf distribution in Stan:

See: http://mathworld.wolfram.com/ZipfDistribution.html

The pmf is involves the Riemann zeta function, which is available from Boost:

http://www.boost.org/doc/libs/1_55_0/libs/math/doc/html/math_toolkit/zetas/zeta.html

so we could add it directly with auto-diff. But auto-diffing these numerical
approximations to functions isn't ideal.

Plus, we really need log_zeta for Stan, and then we'd want a direct scheme
for evaluating both

log(zeta(s)

and

  d/ds log(zeta(s)) = 1/zeta(s) d/ds zeta(s).

See also, this paper by Choudhury (1995), which is what the Mathworld page cites: https://www.jstor.org/stable/52768?seq=1#page_scan_tab_contents

Copied from original issue: stan-dev/stan#551

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

No source file, test, or entry point is named. Begin with the MathWorld Zipf description, Boost's zeta documentation, and the cited Choudhury paper; the issue is done when Stan has a suitable log_zeta and Zipf distribution with automatic differentiation support.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.