stan-dev / stan-dev/math

Additional combinatorial functions and polynomials

Open
#2,309 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

This is a request for additional polynomial functions in Stan. I think it's as easy as wrapping boost functions from
boost sf_poly https://www.boost.org/doc/libs/1_75_0/libs/math/doc/html/math_toolkit/sf_poly/ the relevant hpp files are at https://github.com/boostorg/math/tree/develop/include/boost/math/special_functions.

That contains the following:
With derivatives

  • gegenbauer.html
  • jacobi.html
  • legendre.html
  • chebyshev.html
  • cardinal_b_splines.html

Without

  • legendre_stieltjes.html
  • hermite.html
  • sph_harm.html
  • laguerre.html

A closed issue about chebyshev polynomials (issue 37 stan-dev) where the OP wrote it themselves and didn't need it in Stan.

I'm most interested in getting jacobi, legendre, hermite and laguerre.

Updates:
Legendre, Gegenbauer, and Chebyshev can all be derived from jacobi see https://people.sc.fsu.edu/~jburkardt/cpp_src/jacobi_polynomial/jacobi_polynomial.html.

Hermite polynomial has an easy derivative
Screen Shot 2021-06-09 at 6 42 46 AM

Laguerre as well
Screen Shot 2021-06-09 at 6 52 24 AM

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 reading Boost's sf_poly documentation and the relevant headers in boost/math/special_functions. Compare the requested Jacobi, Legendre, Hermite, and Laguerre functions and their derivative requirements. Done means the prioritized polynomial functions are integrated into Stan Math with the requested derivative support.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.