Package: mhn 0.1.2

mhn: The Modified Half-Normal Distribution

Provides density, distribution, quantile, and random generation functions for the Modified Half-Normal (MHN) distribution, along with moments and mode; the Fox-Wright Psi normalizing constant is evaluated internally. The MHN distribution arises as a conditional posterior in Bayesian Markov chain Monte Carlo and generalizes the half-normal, truncated normal, and square-root gamma distributions. Implements efficient sampling via Algorithms 1 and 3 of Sun, Kong & Pal (2023) <doi:10.1080/03610926.2021.1934700>, the relaxed transformed density rejection method of Gao & Wang (2025) <doi:10.1080/03610918.2025.2524551>, and, for the truncated normal special case, the sampler of Robert (1995) <doi:10.1007/BF00143942>.

Authors:Tomotaka Momozaki [aut, cre]

mhn_0.1.2.tar.gz
mhn_0.1.2.zip(r-4.7-x86_64)mhn_0.1.2.zip(r-4.7-arm64)mhn_0.1.2.zip(r-4.6-x86_64)mhn_0.1.2.zip(r-4.6-arm64)mhn_0.1.2.zip(r-4.5-x86_64)
mhn_0.1.2.tgz(r-4.6-x86_64)mhn_0.1.2.tgz(r-4.6-arm64)mhn_0.1.2.tgz(r-4.5-x86_64)mhn_0.1.2.tgz(r-4.5-arm64)
mhn_0.1.2.tar.gz(r-4.7-arm64)mhn_0.1.2.tar.gz(r-4.7-x86_64)mhn_0.1.2.tar.gz(r-4.6-arm64)mhn_0.1.2.tar.gz(r-4.6-x86_64)
mhn_0.1.2.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
mhn/json (API)

# Install 'mhn' in R:
install.packages('mhn', repos = c('https://t-momozaki.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/t-momozaki/mhn/issues

Pkgdown/docs site:https://t-momozaki.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

cpp

4.85 score 6 scripts 475 downloads 9 exports 2 dependencies

Last updated from:07a7591f02. Checks:15 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK204
linux-devel-x86_64OK208
source / vignettesOK237
linux-release-arm64OK200
linux-release-x86_64OK255
macos-release-arm64OK227
macos-release-x86_64OK444
macos-oldrel-arm64OK212
macos-oldrel-x86_64OK461
windows-devel-arm64OK355
windows-devel-x86_64OK444
windows-release-arm64OK399
windows-release-x86_64OK362
windows-oldrel-x86_64OK259
wasm-releaseOK141

Exports:dmhnmhn_kurtosismhn_meanmhn_modemhn_skewnessmhn_varpmhnqmhnrmhn

Dependencies:BHRcpp

Theoretical background of the mhn package
Scope | The MHN($\alpha$, $\beta$, $\gamma$) family | Shape and moments | The Fox–Wright $\Psi$ normalising constant | Sampling: Sun et al. (2023) | Algorithm 1 — $\gamma > 0$, $\alpha > 1$ | Algorithm 3 — $\gamma \leq 0$ | Why Algorithm 2 is not implemented | Sampling: Gao & Wang (2025) RTDR | $T_{c}$-concavity | Working on the log axis when $\alpha < 1$ | The four regions | Why "relaxed" | The rmhn(method = "auto") dispatch | References | Appendix A. Numerical details | A.1 Special cases and their neighbourhoods | A.2 Moments and mode | A.3 Evaluating $\Psi$ | A.4 Density, distribution and quantile functions | Shared by the three functions | Density | Distribution function | Quantile function | A.5 Random generation at extreme parameters | A.6 Timings behind method = "auto" | Appendix B. Misprints in the source papers | B.1 Sun et al. (2023) | B.2 Gao & Wang (2025)

Last update: 2026-10-23
Started: 2026-05-18

Introduction to the mhn Package
The MHN distribution | Density: dmhn() | Distribution function: pmhn() | Quantile function: qmhn() | Random generation: rmhn() | Moments and mode | Special cases | Further reading | References

Last update: 2026-10-20
Started: 2026-05-18