densityratio
Distribution Comparison Through Density Ratio Estimation
Description
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.
Downloads
227
Last 30 days
14343rd
458
Last 90 days
458
Last year
Trend: -1.7% (30d vs prior 30d)
CRAN Check Status
Show all 14 flavors
| Flavor | Status |
|---|---|
| r-devel-linux-x86_64-debian-clang | NOTE |
| r-devel-linux-x86_64-debian-gcc | NOTE |
| r-devel-linux-x86_64-fedora-clang | OK |
| r-devel-linux-x86_64-fedora-gcc | OK |
| r-devel-macos-arm64 | OK |
| r-devel-windows-x86_64 | OK |
| r-oldrel-macos-arm64 | NOTE |
| r-oldrel-macos-x86_64 | NOTE |
| r-oldrel-windows-x86_64 | OK |
| r-patched-linux-x86_64 | OK |
| r-release-linux-x86_64 | OK |
| r-release-macos-arm64 | OK |
| r-release-macos-x86_64 | OK |
| r-release-windows-x86_64 | OK |
Check details (14 non-OK)
tests
Running ‘testthat.R’ [275s/63s] Running R code in ‘testthat.R’ had CPU time 4.3 times elapsed time
tests
Running ‘testthat.R’ [167s/51s] Running R code in ‘testthat.R’ had CPU time 3.3 times elapsed time
*
*
*
*
installed package size
installed size is 8.1Mb
sub-directories of 1Mb or more:
libs 6.3Mb
installed package size
installed size is 8.3Mb
sub-directories of 1Mb or more:
libs 6.4Mb
*
*
*
*
*
*
Check History
NOTE 10 OK · 4 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 9, 2026
tests
Running ‘testthat.R’ [275s/63s] Running R code in ‘testthat.R’ had CPU time 4.3 times elapsed time
tests
Running ‘testthat.R’ [167s/51s] Running R code in ‘testthat.R’ had CPU time 3.3 times elapsed time
installed package size
installed size is 8.1Mb
sub-directories of 1Mb or more:
libs 6.3Mb
installed package size
installed size is 8.3Mb
sub-directories of 1Mb or more:
libs 6.4Mb