Skip to content

densityratio

0.2.3

Distribution Comparison Through Density Ratio Estimation

1packages depend
3.4Kdownloads / year
97.0%test coverage
13/13checks pass

Overview

About
Maintained by Thom VolkerFirst published 2025-05-194 releasesCRAN page ↗GitHub ↗

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.

Install

Health

CRAN checks
13OK
Slowest check: 7.6 min · r-oldrel-windows-x86_64
Code health
Yes
Tests · ratio 0.36
97.0%
Coverage · measured lines
100%
Documentation · exports
5
Dependencies · direct
Check history
  • OK2026-08-05
    13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • NOTE2026-08-01
    12 OK · 1 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • OK2026-07-18
    13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • NOTE2026-04-22
    10 OK · 4 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • ERROR2026-04-18
    9 OK · 4 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE
Show 3 earlier snapshots
  • NOTE2026-04-10
    8 OK · 6 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • ERROR2026-04-09
    8 OK · 5 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE
  • NOTE2026-03-10
    10 OK · 4 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE

Documentation

Documentation
READMEYes · 886 wordsVignettesYes · dynamicpkgdown siteNoNEWSYes · 100% structuredCode of conductNoContributing guideNo
Examples that run
100%
Documented parameters
100%
Return-value docs
100%
References docs
12%

Downloads

3.4K
CRAN downloads in the past year
Rank #10,615 · ~9/day · ~279/mo
Daily download trend is not available in this view yet.
26130 days
90890 days
3.4K1 year
Compare downloads with other packages →
Also on434 r2u9 autocran

Repository

Repository
11Stars
4Forks
6Open issues
0Open PRs
7Releases
450Commits
4Contributors
License GPL-3.0 · 450 commits · Last activity 2026-07-21 · 0% stars, 30d

Stars over time

2025-07-10 · 82026-07-07 · 11

Repository practices

Upstream repositoryBeta

6 development-tooling and community-health practices detected across 5 families in the upstream repository

Checks run against github.com/thomvolker/densityratio on 2026-08-16.

Continuous integration (1)
GitHub Actions
Reproducibility and dev environment (1)
data-raw/
CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
Docs source (1)
README.Rmd
Show all practices
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v1 (2026-07-18)

Dependencies

Declared dependencies
12 external dependencies (excludes base and recommended)
Depends (1)
R >= 2.10
Enhances (0)
none
Reverse dependencies
1direct
0indirect

Code & Tests

Datasets

People & History

People (3)
Maintainer (1)
Author, Maintainer
Authors (1)
Author, Maintainer
Contributors (2)
Package Timeline

4 releases. Pick two to compare their code metrics. R releases are shown for context.

  • 0.2.3Latest
    2026-07-14 · current release · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • 0.2.2
    2025-07-18 · diff ↗
  • 0.2.1
    2025-06-18 · diff ↗
  • 0.2.0
    2025-05-19
  • R
    R 4.5.0 released · 2025-04-11

Package metadata

First published
2025-05-19
Total releases
4 / 1 yrs
License
GPL (>= 3) OSI
Minimum R
≥ 2.10
Bundled data
497 KB / 7 files
Download size
1.4 MB
Installed size
not tracked yet
With dependencies
not tracked yet

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("densityratio")
Volker, T., Gonzalez Poses, C., & van Kesteren, E. (2026). densityratio: Distribution Comparison Through Density Ratio Estimation (Version 0.2.3) [Computer software]. https://doi.org/10.32614/CRAN.package.densityratio

This is what citation() produces when a package has no citation file of its own. If it prints something else, use that.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for densityratio version 0.2.3 [Data set]. HJJB, LLC. Data release v2026-08-22. https://doi.org/10.5281/zenodo.21843040

From data release v2026-08-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy