Bug: LinearTransform shift

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

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
58/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
haskell
Lĩnh vực
backend

Hướng nghiên cứu

Start by reading Statistics.Distribution.Transform and the implementations of mean, maybeMean, entropy, maybeEntropy, and complCumulative; the issue does not name test files. Check how shifted and scaled exponential distributions behave, including negative scales and far-tail complements. Done means the reported mean is 4.0 and the listed scale, entropy, and complement cases behave correctly.

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

Mô tả

Hi, I was working on some statistical exercises in Haskell. It's been a while since I took a course in the topic so I am a bit rusty.

While working on the assignments I needed to use shifted linear transforms of exponential distributions and things looked odd. I am using latest statistics-0.16.5.0

import Statistics.Distribution
import Statistics.Distribution.Exponential
import Statistics.Distribution.Transform

e = exponential 1                  -- E(1): mean 1, variance 1, entropy 1

-- >>> mean (LinearTransform 0 3 e)
-- 1.0
-- expected: 4.0

I am able to produce a fix for that, but since I have some blind spots I used LLM to analyze the code and it report other issues:

  • mean and maybeMean drop the scale
  • entropy and maybeEntropy ignore the scale
  • A negative scale returns the complement of the right answer
  • complCumulative is not defined, so the far tail is lost

If LLM contributions are welcome the following branch can be used https://github.com/haskell/statistics/compare/master...bcardiff:statistics:fix-linear-transform. Let me know if you want me to open a PR with that.

Ngôn ngữ chính
Haskell
Star
309
Fork
77
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 haskell/statistics

Tất cả issue của haskell/statistics

Issue tương tự

Thêm issue về Haskell

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.