Bug: LinearTransform shift

オープン
#234 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
58/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
haskell
領域
backend

調査の方向性

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.

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

説明

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.

主要言語
Haskell
スター
309
フォーク
77
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

haskell/statistics のほかの issue

haskell/statistics の issue をすべて見る

似ている issue

Haskell の issue をもっと見る

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

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