Implement the generalized normal distribution

未關閉
#3,133 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
25/100
Issue 類型
功能
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
cpp
領域
backend

研究方向

首先檢視現有的 normal 和 double_exponential 入口點,以及連結的 Wikipedia 定義。確立新分佈所需的參數化方式、支援的輸入、導數、邊界情況和測試涵蓋率。完成的標準是:廣義分佈已與函式庫一致地實作,且其行為已在相關情況下獲得驗證。

由索引模型根據 Issue 內容生成。

描述

Description

Implement Generalized normal distribution https://en.wikipedia.org/wiki/Generalized_normal_distribution

Why this is useful?

It generalizes the normal (for p=2) and double exponential (Laplace) distribution (for p=1) and in the limit case also the uniform (p → ∞) for the shape parameter p.

These correspond to the $L_p$ norms when used for regularization and in other cases.

For examples:

y ~ normal(X*beta, sigma);

produces the criterion minimize $L_2$ norm of (X*beta-y) (a.k.a. least squares). But then

y ~ double_exponential(X*beta, sigma);

produces the criterion minimize $L_1$ norm of (X*beta-y). (a.k.a. least absolute deviations)

Similarly, in the Bayesian interpretation of ridge and LASSO,

beta ~ normal(0, lambda);
y ~ normal(X*beta, sigma);

produces the $L_2$ regularized ridge and

beta ~ double_exponential(0, lambda);
y ~ normal(X*beta, sigma);

produces the $L_1$ regularized LASSO.

Using the Generalized normal distribution would allow to conveniently use an arbitrary $L_p$ norm for the optimization criterion, or to even find the suitable value of p when used as a parameter.

主要語言
C++
星號
845
分支
225
平均合併
4 天 21 小時
30 天內合併 PR
13

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

stan-dev/math 的其他 Issue

查看 stan-dev/math 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。