Package: DDAWASS 1.0.0

Antonio Irpino

DDAWASS: Discrete Distribution Data Analysis with Wasserstein Distance

S4 classes and methods for the analysis of data described by discrete distributions with finite support (e.g. frequency distributions of ratings, scores or counts observed on groups of individuals), using the L2 Wasserstein metric between quantile functions. It is the discrete counterpart of 'HistDAWass' and provides exact Wasserstein distances (in C++), barycenters, Wasserstein variance, covariance and correlation, k-means and hierarchical clustering, quantile-based principal component and multiple factor analysis, two-component linear regression and reliability (Cronbach's alpha) indices. See Crocetta, Irpino, Antonucci and Marin (2025) <doi:10.1007/s11135-024-01956-0>.

Authors:Antonio Irpino [aut, cre, cph]

DDAWASS_1.0.0.tar.gz
DDAWASS_1.0.0.zip(r-4.7-x86_64)DDAWASS_1.0.0.zip(r-4.7-arm64)DDAWASS_1.0.0.zip(r-4.6-x86_64)DDAWASS_1.0.0.zip(r-4.6-arm64)
DDAWASS_1.0.0.tar.gz(r-4.7-arm64)DDAWASS_1.0.0.tar.gz(r-4.7-x86_64)DDAWASS_1.0.0.tar.gz(r-4.6-arm64)DDAWASS_1.0.0.tar.gz(r-4.6-x86_64)
DDAWASS_1.0.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
DDAWASS/json (API)

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

Bug tracker:https://github.com/airpino/ddawass/issues

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

On CRAN:

Conda:

cpp

3.52 score 11 scripts 45 exports 115 dependencies

Last updated from:ed4cf47346. Checks:10 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK143
linux-devel-x86_64OK190
source / vignettesOK258
linux-release-arm64OK141
linux-release-x86_64OK181
windows-devel-arm64OK246
windows-devel-x86_64OK187
windows-release-arm64OK295
windows-release-x86_64OK146
wasm-releaseOK139

Exports:compPcompQdata2MatDdistributionDdotpDget.cell.MatDget.MatD.ncolsget.MatD.nrowsget.MatD.rownamesget.MatD.statsget.MatD.varnameskurtDlong2MatDMatDMatD2longMatD2tibbleMatH2MatDmeanDplotrQQset.cell.MatDsimplifyDskewDstdDtibble2MatDvarDWassSqDistDWD_hclustWD_kmeansWD_MAT_DISTWD.1d.PCAWD.bind.colWD.bind.rowWD.correlationWD.cronbachWD.MultiplePCAWD.plot.Spanish.fanWD.quantile.matrixWD.regression.GOFWD.regression.two.componentsWD.regression.two.components.predictWD.SSQWD.var.covarWD.vec.meanWD.vec.mean.simplified

Dependencies:abindbackportsbase64encbootbroombslibcachemcarcarDataclasscliclustercolorspacecowplotcpp11crosstalkDerivdigestdoBydplyrDTellipseemmeansestimabilityevaluateFactoMineRfarverfastmapflashClustfontawesomeforecastFormulafracdifffsgenericsggplot2ggrepelggridgesgluegtablehighrHistDAWasshistogramhtmltoolshtmlwidgetsirlbaisobandjquerylibjsonliteknitrlabelinglaterlatticelazyevalleapslifecyclelme4lmtestmagrittrMASSMatrixMatrixModelsmemoisemgcvmimeminqamodelrmultcompViewmvtnormnlmenloptrnnetnumDerivotelpbkrtestpillarpkgconfigpromisespurrrquantregR6rappdirsrbibutilsRColorBrewerRcppRcppArmadilloRcppEigenRdpackreformulasrlangrmarkdownS7sassscalesscatterplot3dshowtextshowtextdbSparseMstringistringrsurvivalsysfontstibbletidyrtidyselecttimeDatetinytexurcautf8vctrsviridisLitewithrxfunyamlzoo

Building discrete distributional data
The data: evaluation of the orientation services | From microdata to a MatD | Inspecting the data | Other ways of building the data | Next steps | References

Last update: 2026-11-04
Started: 2026-11-04

Basic statistics of discrete distributional data
1. Statistics of a single distribution | 2. Statistics of all the cells | 3. The Wasserstein barycenter | A barycenter on the original categories | Barycenter versus pooled distribution | 4. Wasserstein variance and its decomposition | 5. Covariance, correlation and reliability | References

Last update: 2026-11-04
Started: 2026-11-04

Clustering discrete distributional data
Distances between groups | Hierarchical clustering | K-means (dynamic clustering) | Describing the clusters | Standardized clustering | References

Last update: 2026-11-04
Started: 2026-11-04

Linear regression for discrete distributional data
The two-component model | Estimation | Predictions and goodness of fit | Bootstrap confidence intervals | References

Last update: 2026-11-04
Started: 2026-11-04

Principal component analysis of discrete distributional data
The matrix of quantiles | PCA of one distributional variable | Multiple factor analysis of several items | References

Last update: 2026-11-04
Started: 2026-11-04

Linear regression for discrete distributional data
The two-component model | Estimation | Predictions and goodness of fit | Bootstrap confidence intervals | References

Last update: 2026-11-04
Started: 2026-11-04

Readme and manuals

Help Manual

Help pageTopics
Extract a sub-matrix of a MatD[,MatD,ANY,ANY,ANY-method
Arithmetic on discrete distributions*,distributionD,numeric-method *,numeric,distributionD-method +,distributionD,distributionD-method +,distributionD,numeric-method +,numeric,distributionD-method -,distributionD,numeric-method Arith-distributionD
Quantiles and cdf of a discrete distributioncompP,distributionD,ANY-method compP,distributionD-method compQ,distributionD,ANY-method compQ,distributionD-method compQ-distributionD
Build a MatD from raw (micro) datadata2MatD
Constructor of a discrete distributiondistributionD
Class distributionDdistributionD-class
Inner product of quantile functionsdotpD
Statistics of the distributions in a MatDget.MatD.stats
Build a MatD from a long frequency tablelong2MatD
Constructor of a matrix of discrete distributionsMatD
Accessors of a MatD objectget.cell.MatD get.MatD.ncols get.MatD.nrows get.MatD.rownames get.MatD.varnames MatD-accessors set.cell.MatD
Class MatDMatD-class
Convert a MatD into a long data.frameMatD2long
Discretize a matrix of histograms (MatH) into a MatDMatH2MatD
Plot a discrete distributionplot,distributionD-method
Plot a MatDplot,MatD-method
Quantile-quantile correlation of two discrete distributionsrQQ,distributionD,distributionD-method rQQ-distributionD
Simulated hotel satisfaction surveySatisfaction Satisfaction_raw
Project discrete distributions on a fixed supportsimplifyD
Basic statistics of a discrete distributionkurtD kurtD,distributionD-method meanD meanD,distributionD-method skewD skewD,distributionD-method statsD stdD stdD,distributionD-method varD varD,distributionD-method
Convert legacy nested tibbles into a MatD (and back)MatD2tibble tibble2MatD
L2 Wasserstein distance between discrete distributionsWassSqDistD WassSqDistD,distributionD,distributionD-method
Hierarchical clustering of discrete distributional dataWD_hclust
K-means clustering of discrete distributional dataWD_kmeans
Matrix of L2 Wasserstein distances between the rows of a MatDWD_MAT_DIST
Principal component analysis of a single discrete distributional variableWD.1d.PCA
Bind MatD objects by rows or by columnsWD.bind WD.bind.col WD.bind.row
Cronbach's alpha for discrete distributional variablesWD.cronbach
Multiple factor analysis of discrete distributional variablesWD.MultiplePCA
Spanish-fan plot of a quantile PCAWD.plot.Spanish.fan
Matrix of quantiles of a MatDWD.quantile.matrix
Goodness of fit indices for distributional regressionWD.regression.GOF
Two-component regression of discrete distributional variablesWD.regression.two.components
Predictions of the two-component regressionWD.regression.two.components.predict
Total sum of squares of a discrete distributional variableWD.SSQ
Wasserstein variance-covariance and correlation matricesWD.correlation WD.var.covar
Barycenter (Frechet mean) of discrete distributional variablesWD.vec.mean
Barycenter expressed on the original support valuesWD.vec.mean.simplified