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

Đang mở
#3,302 5 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
cpp
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu với các entry point neg_binomial_2_lpmf và neg_binomial_2_log_lpmf, rồi so sánh việc xác thực location của chúng với poisson_lpmf và poisson_log_lpmf. Công việc được xem là hoàn tất khi các hàm phân phối nhị thức âm chấp nhận nhất quán các trường hợp zero và negative_infinity() được yêu cầu với các hàm Poisson, đồng thời hành vi liên quan được bao phủ bằng các bài kiểm thử.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?

Ngôn ngữ chính
C++
Star
845
Fork
225
Merge trung bình
3 ngày 9 giờ
Pull request đã merge (30 ngày)
12

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của stan-dev/math

Tất cả issue của stan-dev/math

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.