stdlib-js / stdlib-js/stdlib

[RFC]: Tracking issue for complete implementation of `@stdlib/stats/base/dists/halfnormal` package

オープン
#9,416 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
6k
フォーク
1.3k
平均マージ
1日 3時間
マージ済み PR(30日)
611

説明

### Description

This tracking issue proposes adding comprehensive support for the half-normal distribution in `@stdlib/stats/base/dists/halfnormal`. The half-normal distribution is the distribution of the absolute value of a normally distributed random variable with mean 0. It is commonly used in statistical applications such as stochastic frontier analysis, modeling measurement errors, and other fields where only the magnitude of a normally distributed variable is of interest.

## Rationale

**Why is this feature important?**

1. **Completeness**: Expanding stdlib's statistical distributions library to include the half-normal distribution provides users with a comprehensive set of tools for statistical analysis.

2. **Common Use Cases**: The half-normal distribution is widely used in:
- Stochastic frontier analysis
- Quality control and process capability studies
- Modeling absolute deviations and measurement errors
- Bayesian analysis as a prior distribution

3. **Consistency**: Following stdlib's existing patterns for probability distributions ensures a consistent API and user experience.

4. **Scientific Computing**: Enables researchers and data scientists to perform half-normal distribution calculations natively within stdlib without external dependencies.

## Proposed Solution

**How do you propose to implement this feature?**

Implement the half-normal distribution following the established pattern used for other continuous distributions in stdlib (e.g., normal, exponential, gamma). This includes creating subpackages for various distribution functions, properties, and utilities within `@stdlib/stats/base/dists/halfnormal/`.

## Implementation Checklist

The following subpackages need to be implemented for the half-normal distribution:

### Core Distribution Functions

- [ ] **`@stdlib/stats/base/dists/halfnormal/cdf`** - Cumulative distribution function (CDF)
- [ ] **`@stdlib/stats/base/dists/halfnormal/pdf`** - Probability density function (PDF)
- [ ] **`@stdlib/stats/base/dists/halfnormal/quantile`** - Quantile function (inverse CDF)
- [ ] **`@stdlib/stats/base/dists/halfnormal/logcdf`** - Logarithm of cumulative distribution function
- [ ] **`@stdlib/stats/base/dists/halfnormal/logpdf`** - Logarithm of probability density function

### Distribution Properties

- [ ] **`@stdlib/stats/base/dists/halfnormal/mean`** - Expected value (mean)
- [ ] **`@stdlib/stats/base/dists/halfnormal/median`** - Median
- [ ] **`@stdlib/stats/base/dists/halfnormal/mode`** - Mode
- [ ] **`@stdlib/stats/base/dists/halfnormal/variance`** - Variance
- [ ] **`@stdlib/stats/base/dists/halfnormal/stdev`** - Standard deviation
- [ ] **`@stdlib/stats/base/dists/halfnormal/entropy`** - Differential entropy
- [ ] **`@stdlib/stats/base/dists/halfnormal/skewness`** - Skewness
- [ ] **`@stdlib/stats/base/dists/halfnormal/kurtosis`** - Excess kurtosis

### Generating Functions

- [ ] **`@stdlib/stats/base/dists/halfnormal/mgf`** - Moment-generating function (MGF)

### Constructor and Utilities

- [ ] **`@stdlib/stats/base/dists/halfnormal/ctor`** - Distribution constructor

### Main Package

- [ ] **`@stdlib/stats/base/dists/halfnormal`** - Main package with exports and documentation

### Related Issues

- #8205 - Original RFC for half-normal distribution support
- #6951 - Related issue mentioned in #8205

### Questions

- Are there any additional distribution-specific functions that should be included beyond the standard set?
- Should we implement any specialized constants related to the half-normal distribution?

### Other

No.

### Checklist

- [x] I have read and understood the [Code of Conduct](https://github.com/stdlib-js/stdlib/blob/develop/CODE_OF_CONDUCT.md).
- [x] Searched for existing issues and pull requests.
- [x] The issue name begins with `RFC:`.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start by reviewing the existing normal, exponential, and gamma distribution patterns in @stdlib/stats/base/dists, then read related issues #8205 and #6951. Done means implementing the listed halfnormal subpackages, wiring the main package exports and documentation, and resolving the open questions about additional functions and constants.

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

評価

技術スタック
javascript
領域
data
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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