Density Ratio Estimation (uLSIF) with Least-Squares Two-Sample Test
The method estimates the ratio of two probability densities directly, without estimating either density, by fitting a non-negative combination of Gaussian kernels that minimises the squared error to the true ratio (unconstrained least-squares importance fitting). The kernel width and regularisation are chosen by cross-validation, the fitted ratio gives the Pearson divergence between the two samples, and a permutation of the group labels tests whether that divergence is larger than chance.
두 확률밀도를 따로 추정하지 않고 그 비를 바로 추정합니다. 가우스 커널의 음이 아닌 선형결합으로 참 밀도비와의 제곱오차를 최소화하며(uLSIF), 커널 폭과 정칙화는 교차검증으로 고릅니다. 추정한 비로 두 표본 사이의 피어슨 발산을 구하고, 집단 표시를 섞는 순열검정으로 그 크기가 우연보다 큰지 검정합니다.
How much more likely is each observation under one sample's distribution than under the other's, and do the two distributions differ?
각 관측값이 한 표본의 분포에서 다른 표본의 분포보다 얼마나 더 나올 법한지, 그리고 두 분포가 다른지 알고 싶습니다.
The method reports the chosen kernel width and regularisation, the estimated ratio summarised in each sample, the Pearson divergence and its permutation p-value.
When to use Density Ratio Estimation (uLSIF) with Least-Squares Two-Sample Test
- You need importance weights to reweight one sample so that it resembles another (covariate shift, transfer of a model).
- You want a multivariate two-sample comparison that also tells you where the distributions differ.
- The data have several numeric features and moderate sample sizes.
When to use something else
- You only need a yes or no test of equal distributions: use Kernel Two-Sample Test (Maximum Mean Discrepancy)
- You want to know whether a classifier can tell the samples apart: use Covariate Shift Detection (Classifier Two-Sample Test)
- One variable and a simple shift in location: use Mann-Whitney U Test
Assumptions and requirements
- Independent observations in both samples
- The numerator distribution has no mass where the denominator density is zero
- Numeric features on comparable scales (standardised by default)
What the analysis reports
- Estimated density ratio for every row
- Kernel width and regularisation chosen by cross-validation
- Pearson divergence
- Permutation p-value of the least-squares two-sample test
How to report it
The density ratio of [value] to [value] was estimated by uLSIF (sigma = [value], lambda = [value]); the Pearson divergence was [value], permutation p = [value].
Related methods
- Kernel Two-Sample Test (Maximum Mean Discrepancy)
- Covariate Shift Detection (Classifier Two-Sample Test)
- Energy Distance Test of Equal Distributions (Two- and k-Sample)
- Kernel Density Estimation
How this method is validated
이 방법의 검증 근거
- Independent computation. 3 reference tests compare the results with SciPy and direct computations (formulas, enumeration or simulation).
독립 계산. SciPy·직접 계산(식·열거·모의실험) 대조 참조 시험 3건 통과.
Tolerances are relative differences (absolute differences for values near zero). R comparisons and reference tests are re-run before each release of the analysis engine.
허용오차는 상대 차이입니다(0 근처 값은 절대 차이). R 대조와 참조 시험은 분석 엔진을 배포할 때마다 다시 돌립니다.
Run Density Ratio Estimation (uLSIF) with Least-Squares Two-Sample Test on Quorant
- Data you need
- a table (CSV or Excel) with predictor (feature) columns and a grouping variable
- Price
- 600 credits for one analysis up to 10,000 rows (complexity level 4); larger or wider data costs more. Optional methodologist review: 2400 credits.
- Checking
- Compared with independent computations
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.