densityratio: Distribution Comparison Through Density Ratio Estimation

Fast, flexible and user-friendly tools for distribution comparison through direct density ratio estimation. The estimated density ratio can be used for covariate shift adjustment, outlier-detection, change-point detection, classification and evaluation of synthetic data quality. The package implements multiple non-parametric estimation techniques (unconstrained least-squares importance fitting, ulsif(), Kullback-Leibler importance estimation procedure, kliep(), spectral density ratio estimation, spectral(), kernel mean matching, kmm(), and least-squares hetero-distributional subspace search, lhss()). with automatic tuning of hyperparameters. Helper functions are available for two-sample testing and visualizing the density ratios. For an overview on density ratio estimation, see Sugiyama et al. (2012) <doi:10.1017/CBO9781139035613> for a general overview, and the help files for references on the specific estimation techniques.

Package details

AuthorThom Volker [aut, cre] (ORCID: <https://orcid.org/0000-0002-2408-7820>), Carlos Gonzalez Poses [ctb], Erik-Jan van Kesteren [ctb]
MaintainerThom Volker <thombenjaminvolker@gmail.com>
LicenseGPL (>= 3)
Version0.2.0
URL https://thomvolker.github.io/densityratio/
Package repositoryView on CRAN
Installation Install the latest version of this package by entering the following in R:
install.packages("densityratio")

Try the densityratio package in your browser

Any scripts or data that you put into this service are public.

densityratio documentation built on June 8, 2025, 11:17 a.m.