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) tools:::Rd_expr_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) tools:::Rd_expr_doi("10.1080/01621459.2021.2016422"), even many zeros (Scealy, Hingee, Kent, and Wood, 2024) tools:::Rd_expr_doi("10.1007/s11222-024-10412-w"). A partial interface to CppAD's ADFun objects is also available.
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 scealy2024roscorematchingad.
We developed this package on Ngunnawal and Ngambri Country. We thank the Country for its influence.
Maintainer: Kassel Liam Hingee kassel.hingee@anu.edu.au (ORCID)
Authors:
Janice Scealy (ORCID)
Other contributors:
Bradley M. Bell [copyright holder]
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
and Eigen
to differentiate model densities and compute the score matching discrepancy function (see scorematchingtheory
).
The score matching discrepancy is usually minimised by solving a quadratic equation, but a method for solving numerically (through optimx::Rcgmin()
) is also included.
New models can be fitted with the help of tape_uld()
in a similar fashion to models in the TMB
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 scealy2023sc,scealy2024roscorematchingad. See function ppi()
.
Score matching and hybrid score matching estimators for von Mises Fisher, Bingham and Fisher-Bingham directional distributions mardia2016scscorematchingad. See vMF()
, Bingham()
and FB()
.
Implementation of a modification of Windham's robustifying method windham1995roscorematchingad 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 scealy2024roscorematchingad.
An interface of CppAD
's ADFun
tape objects. See Rcpp_ADFun
.
For an introduction to score matching estimation, see scorematchingtheory
.
*scorematchingad
Useful links: