hanalyze-core: Bottom layer of hanalyze: stats, tests, optimisation, MCMC core

[ bsd3, library, machine-learning, math, numeric, statistics ] [ Propose Tags ] [ Report a vulnerability ]

The bottom layer of the hanalyze toolkit: pure numerics with no dataframe and no Bayesian dependency. Descriptive statistics, hypothesis tests (t Welch F chi-square Hotelling T2 / MANOVA), 40+ distributions, effect sizes, bootstrap and cross-validation, SPC control charts (including EWMA and CUSUM), single- and multi-objective optimisation (Nelder-Mead, L-BFGS, CMA-ES, NSGA-II, ...), plus the sampler-agnostic MCMC Chain type and its diagnostics. . Module names match the umbrella package hanalyze, which re-exports everything, so downstream imports stay identical. See README.md for the module map and a standalone usage example.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.2.0.1
Dependencies base (>=4.14 && <5), containers (>=0.6 && <0.8), deepseq (>=1.4 && <1.6), hmatrix (>=0.20 && <0.22), mwc-random (>=0.15 && <0.16), primitive (>=0.7 && <0.10), statistics (>=0.16 && <0.17), text (>=1.2 && <2.2), vector (>=0.12 && <0.14), vector-algorithms (>=0.9 && <0.10) [details]
Tested with ghc ==9.6.7
License BSD-3-Clause
Copyright 2026 Aelysce Project (Toshiaki Honda)
Author Toshiaki Honda
Maintainer frenzieddoll@gmail.com
Uploaded by frenzieddoll at 2026-08-13T05:54:45Z
Category Math, Statistics, Numeric, Machine Learning
Distributions
Reverse Dependencies 6 direct, 2 indirect [details]
Downloads 1 total (1 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-08-13 [all 1 reports]

Readme for hanalyze-core-0.2.0.1

[back to package description]

hanalyze-core

The bottom layer of hanalyze — pure numerics with no dataframe and no Bayesian dependency: descriptive statistics, hypothesis tests, distributions, optimisation, and the MCMC abstractions.

It depends only on 10 external packages (base / hmatrix / vector / statistics / containers / mwc-random and friends) and on no other package in this repository. Every upper layer (-frame / -bayes / -models / -design / -viz) goes through it.

Main modules (44 in total)

Statistics (Hanalyze.Stat.*)

Module Role
Stat.Descriptive The single source of truth for univariate descriptive statistics (mean / variance / quantiles / skewness / kurtosis). All upper-layer aggregation delegates here
Stat.Test Unifies the test family behind a single TestResult type (t / Welch / F / χ² / non-parametric / Hotelling T² one- and two-sample / one-way MANOVA)
Stat.Distribution pdf / cdf / quantile / sampling for 40+ distributions
Stat.Effect Effect sizes (Cohen's d / Hedges' g / η² / Cliff's δ)
Stat.Bootstrap / Stat.CV Bootstrap confidence intervals / cross-validation splitters
Stat.MultipleTesting Multiple-comparison correction (Bonferroni / Holm / BH-FDR)
Stat.SPC Statistical process control — variable charts (X̄-R / I-MR), attribute charts (p / np / c / u) and EWMA / CUSUM, with Western Electric / Nelson rules
Stat.GroupComparison Good-vs-bad group comparison (goodVsBad — ranks every variable by Welch's t-test and Cohen's d)
Stat.ClassMetrics Classification metrics (confusion matrix / ROC-AUC / F1)

Optimisation (Hanalyze.Optim.*)

Module Role
Optim.NelderMead Derivative-free simplex method, the default of R's optim(method="Nelder-Mead")
Optim.LBFGS / Optim.GradAscent / Optim.Adam Gradient-based methods
Optim.CMAES / Optim.DifferentialEvolution / Optim.ParticleSwarm / Optim.SimulatedAnnealing Global optimisation
Optim.NSGA / Optim.Pareto Multi-objective optimisation — NSGA-II (Deb et al. 2002) and Pareto-front utilities
Optim.Constrained / Optim.Desirability Augmented-Lagrangian constrained optimisation / desirability scalarisation (Derringer & Suich 1980)

Foundations (MCMC.Core / Model.Core / Math.*)

Module Role
MCMC.Core Sampler-agnostic Chain type and posterior statistics (posteriorMean / posteriorSD / posteriorQuantile). The base for using MCMC.* as a standalone sampling library
Stat.MCMC MCMC diagnostics — rhat / ess / essBulk / hdi / autocorr / bfmi (the samplers themselves live in -bayes)
Model.Core The Result type and Model class shared by every regression model
Math.HSIC / Math.ICA / Math.Hungarian HSIC independence statistic / FastICA (Hyvärinen 1999) / Hungarian assignment

Using it standalone

If you do not need the upper layers, depend on this package directly:

build-depends: hanalyze-core, hmatrix
import qualified Hanalyze.Stat.Test as ST
import qualified Numeric.LinearAlgebra as LA

main = do
  let xs = LA.fromList [12, 14, 13, 15, 17, 11]
      ys = LA.fromList [18, 22, 20, 19, 25, 17]
      result = ST.tTestWelch xs ys ST.TwoSided
  print (ST.trPValue result, ST.trEffect result)
  -- (1.688e-3, Just ("Cohen's d", -2.527))

Normally you would just depend on the umbrella package hanalyze and get all of the above from a single import Hanalyze. Naming a layer directly is only worth it when you want to minimise dependencies.

repository README