scorematchingad-package {scorematchingad} | R Documentation |
scorematchingad: Score Matching Estimation by Automatic Differentiation
Description
Hyvärinen's score matching (Hyvärinen, 2005) <https://jmlr.org/papers/v6/hyvarinen05a.html> is a useful estimation technique when the normalising constant for a probability distribution is difficult to compute. This package implements score matching estimators using automatic differentiation in the 'CppAD' library <https://github.com/coin-or/CppAD> and is designed for quickly implementing score matching estimators for new models. Also available is general robustification (Windham, 1995) <https://www.jstor.org/stable/2346159>. Already in the package are estimators for directional distributions (Mardia, Kent and Laha, 2016) <doi:10.48550/arXiv.1604.08470> and the flexible Polynomially-Tilted Pairwise Interaction model for compositional data. The latter estimators perform well when there are zeros in the compositions (Scealy and Wood, 2023) <doi:10.1080/01621459.2021.2016422>, even many zeros (Scealy, Hingee, Kent, and Wood, 2024) <doi:10.1007/s11222-024-10412-w>.
Details
This package's main features are
A general capacity to implement score matching estimators that use algorithmic differentiation to avoid tedious manual algebra. The package uses
CppAD
andEigen
to differentiate model densities and compute the score matching discrepancy function (seescorematchingtheory
). The score matching discrepancy is usually minimised by solving a quadratic equation, but a method for solving numerically (throughoptimx::Rcgmin()
) is also included. On Linux platforms using thegcc
compiler new models can be fitted with the help ofcustomll()
, in a similar fashion to models in theTMB
package. New manifolds or new transforms require small alterations to the source code of this package.Score matching estimators for the Polynomially-Tilted Pairwise Interaction (PPI) model (Scealy and Wood 2023; Scealy et al. 2024). See function
ppi()
.Score matching and hybrid score matching estimators for von Mises Fisher, Bingham and Fisher-Bingham directional distributions (Mardia et al. 2016). See
vMF()
,Bingham()
andFB()
.Implementation of a modification of Windham's robustifying method (Windham 1995) for many exponential family distributions. See
Windham()
. For some models the density approaches infinity at some locations, creating difficulties for the weights in Windham's original method (Scealy et al. 2024).
Acknowledgements
Colleagues Andrew T. A. Wood and John T. Kent played important roles in developing the statistical ideas and theory for score matching estimation for the PPI model (Scealy et al. 2024).
We developed this package on Ngunnawal and Ngambri Country. We thank the Country for its influence.
Author(s)
Maintainer: Kassel Liam Hingee kassel.hingee@anu.edu.au (ORCID)
Authors:
Janice Scealy (ORCID)
Other contributors:
Bradley M. Bell [copyright holder]
References
Amaral GJA, Dryden IL, Wood ATA (2007).
“Pivotal Bootstrap Methods for k-Sample Problems in Directional Statistics and Shape Analysis.”
Journal of the American Statistical Association, 102(478), 695–707.
27639898, http://www.jstor.org/stable/27639898.
Bell B (2023).
“CppAD: A Package for Differentiation of C++ Algorithms.”
https://github.com/coin-or/CppAD.
Hyvärinen A (2005).
“Estimation of Non-Normalized Statistical Models by Score Matching.”
Journal of Machine Learning Research, 6(24), 695–709.
https://jmlr.org/papers/v6/hyvarinen05a.html.
Hyvärinen A (2007).
“Some extensions of score matching.”
Computational Statistics & Data Analysis, 51(5), 2499–2512.
doi:10.1016/j.csda.2006.09.003.
Liu S, Kanamori T, Williams DJ (2019).
“Estimating Density Models with Truncation Boundaries using Score Matching.”
doi:10.48550/arXiv.1910.03834.
Mardia K (2018).
“A New Estimation Methodology for Standard Directional Distributions.”
In 2018 21st International Conference on Information Fusion (FUSION), 724–729.
doi:10.23919/ICIF.2018.8455640.
Mardia KV, Jupp PE (2000).
Directional Statistics, Probability and Statistics.
Wiley, Great Britain.
ISBN 0-471-95333-4.
Mardia KV, Kent JT, Laha AK (2016).
“Score matching estimators for directional distributions.”
doi:10.48550/arXiv.1604.08470.
Martin I, Uh H, Supali T, Mitreva M, Houwing-Duistermaat JJ (2019).
“The mixed model for the analysis of a repeated-measurement multivariate count data.”
Statistics in Medicine, 38(12), 2248–2268.
doi:10.1002/sim.8101.
Scealy JL, Hingee KL, Kent JT, Wood ATA (2024).
“Robust score matching for compositional data.”
Statistics and Computing, 34, 93.
doi:10.1007/s11222-024-10412-w.
Scealy JL, Wood ATA (2023).
“Score matching for compositional distributions.”
Journal of the American Statistical Association, 118(543), 1811–1823.
doi:10.1080/01621459.2021.2016422.
Windham MP (1995).
“Robustifying Model Fitting.”
Journal of the Royal Statistical Society. Series B (Methodological), 57(3), 599–609.
2346159, http://www.jstor.org/stable/2346159.
Wiria AE, Prasetyani MA, Hamid F, Wammes LJ, Lell B, Ariawan I, Uh HW, Wibowo H, Djuardi Y, Wahyuni S, Sutanto I, May L, Luty AJ, Verweij JJ, Sartono E, Yazdanbakhsh M, Supali T (2010).
“Does treatment of intestinal helminth infections influence malaria?”
BMC Infectious Diseases, 10, 77.
doi:10.1186/1471-2334-10-77.
Yu S, Drton M, Shojaie A (2019).
“Generalized Score Matching for Non-Negative Data.”
Journal of Machine Learning Research, 20(76), 1–70.
https://jmlr.org/papers/v20/18-278.html.
Yu S, Drton M, Shojaie A (2020).
“Generalized Score Matching for General Domains.”
doi:10.48550/arXiv.2009.11428.
See Also
Useful links:
Report bugs at https://github.com/kasselhingee/scorematchingad/issues