Feature request: permit location of 0/negative_infinity() in neg_binomial_2(_log)_lpmf

オープン
#3,302 コメント 5 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
cpp
領域
tooling

調査の方向性

neg_binomial_2_lpmf と neg_binomial_2_log_lpmf のエントリーポイントから始め、これらの位置の検証を poisson_lpmf および poisson_log_lpmf と比較してください。負の二項関数が、Poisson 関数と一貫して、要求された zero および negative_infinity() のケースを受け入れ、関連する動作がテストでカバーされていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

distributions good first issue numerics

Good day,

It is currently possible to have location parameter of 0 in poisson_lpmf and negative_infinity() in poisson_log_lpmf; I've also verified this works with the _glm functions:

model {
  real works = poisson_lpmf(1 | 0),
       works2 = poisson_log_lpmf(1 | negative_infinity());
}

However, this is not possible with neg_binomial_2 functions:

model {
  real fails = neg_binomial_2_lpmf(1 | 0, 1),
       fails2 = neg_binomial_2_log_lpmf(1 | negative_infinity(), 1);
}

which errors out with:

Exception: neg_binomial_2_lpmf: Location parameter is 0, but must be positive finite!

I think it would be reasonable to permit similar behaviour as for the Poisson functions?

主要言語
C++
スター
845
フォーク
225
平均マージ
3日 9時間
マージ済み PR(30日)
12

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

stan-dev/math のほかの issue

stan-dev/math の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。