starSampler | R Documentation |
A function implementing Algorithm 2 in \insertCiteBB2025DRPT;textualDRPT.
starSampler(X, Y, r, H = 99, S = 50)
X |
A numeric vector containing the first sample. |
Y |
A numeric vector containing the second sample. |
r |
A function specifying the hypothesised density ratio. |
H |
An integer specifying the number of permutations to use. Defaults to 99. |
S |
An integer specifying the number of steps for the Markov-Chain defined in Algorithm 2 in \insertCiteBB2025DRPT;textualDRPT. Defaults to 50. |
A list of H+1
rearrangements of the whole sample. The first element of
the list is the original dataset. The other H
elements are permutations of the original
dataset, where permutations are generated using Algorithm 2 in the paper.
BB2025DRPTDRPT
n = 250; m = n
r = function(x,y) {
return(4*x*y)
}
X = as.matrix(cbind(runif(n, 0, 1), runif(n, 0, 1)))
Y = as.matrix(cbind(rbeta(m, 0.5, 0.3), rbeta(m, 0.5, 0.4)))
starSampler(X, Y, r, H = 3, S = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.