KSMMD: Stata module to perform Weighted k-sample distributional test combining Kolmogorov-Smirnov (Kiefer's T) and Maximum Mean Discrepancy (MMD via Random Fourier Features)
Andres Talavera Cuya ()
Additional contact information
Andres Talavera Cuya: Direccion Nacional de Censos y Encuestas -- INEI Peru
Statistical Software Components from Boston College Department of Economics
Abstract:
ksmmd tests whether k >= 2 groups (named by by()) come from the same distribution of varname, computing two test statistics from a single permutation resample: o a k-sample generalization of the Kolmogorov-Smirnov test (Kiefer's T -- Kiefer 1959), the same statistic kstest (Ariel Linden, SSC s459801) computes, but reimplemented here so that varname is sorted once (not re-sorted on every permutation) -- see Remarks: why reimplement kstest. o a k-sample generalization of the Maximum Mean Discrepancy (MMD -- Gretton et al. 2012) with an RBF kernel, approximated via Random Fourier Features (Rahimi & Recht 2007) so it stays tractable at survey-sized n (~10^5), unlike mmd_2s (Boston College SSC s459820), which only compares 2 groups with an exact O(N^2) kernel.
Language: Stata
Requires: Stata version 11
Keywords: distributions test; k-sample; KS test (search for similar items in EconPapers)
Date: 2026-09-17, Revised 2026-09-23
Note: This module should be installed from within Stata by typing "ssc install ksmmd". The module is made available under terms of the GPL v3 license.
References: Add references at CitEc
Citations:
Downloads: (external link)
http://fmwww.bc.edu/repec/bocode/k/ksmmd.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/k/ksmmd.sthlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/k/ksmmd_es.sthlp help file (text/plain)
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:boc:bocode:s459893
Ordering information: This software item can be ordered from
http://repec.org/docs/ssc.php
Access Statistics for this software item
More software in Statistical Software Components from Boston College Department of Economics Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA. Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().