Estimate Density Ratio p_nu(x)/p_de(y)

Description

Estimate Density Ratio p_nu(x)/p_de(y)

Usage

1
2
densratio(x, y, method = c("uLSIF", "KLIEP"), sigma = "auto",
  lambda = "auto", kernel_num = 100, fold = 5, verbose = TRUE)

Arguments

x

numeric vector or matrix as data from a numerator distribution p_nu(x).

y

numeric vector or matrix as data from a denominator distribution p_de(y).

method

"uLSIF"(default) or "KLIEP".

sigma

positive numeric vector as a search range of Gaussian kernel bandwidth.

lambda

positive numeric vector as a search range of regularization parameter for uLSIF.

kernel_num

positive integer as number of kernels.

fold

positive integer as a numer of the folds of cross validation for KLIEP.

verbose

logical(default TRUE).

Value

densratio object that contains the function to estimate density ratio.

Examples

1
2
3
4
set.seed(3)
x <- rnorm(200, mean = 1, sd = 1/8)
y <- rnorm(200, mean = 1, sd = 1/2)
densratio(x, y)