Skip to content

Commit

Permalink
fix interface
Browse files Browse the repository at this point in the history
  • Loading branch information
xukai92 committed Sep 11, 2019
1 parent 35a1c63 commit 3fef39c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ratio/moment_matching.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ gaussian_gram_by_pairwise_dot(pdot; σ=1) = exp.(-pdot ./ 2(σ ^ 2))
gaussian_gram(x; σ=1) = gaussian_gram_by_pairwise_dot(pairwise_dot(x); σ=σ)
gaussian_gram(x, y; σ=1) = gaussian_gram_by_pairwise_dot(pairwise_dot(x, y); σ=σ)

function estimate_r_de(x_de, x_nu, get_r_hat=get_r_hat_numerically; σs=[sqrt(median([pdot_dede..., pdot_denu...]))])
function estimate_r_de(x_de, x_nu; get_r_hat=get_r_hat_analytical, σs=nothing, kwargs...)
pdot_dede = pairwise_dot_kai(x_de)
pdot_denu = pairwise_dot_kai(x_de, x_nu)

if isnothing(σs); σs = [sqrt(median([pdot_dede..., pdot_denu...]))]; end

Kdede = mean([gaussian_gram_by_pairwise_dot(pdot_dede; σ=σ) for σ in σs])
Kdenu = mean([gaussian_gram_by_pairwise_dot(pdot_denu; σ=σ) for σ in σs])

return get_r_hat(Kdede, Kdenu)
return get_r_hat(Kdede, Kdenu; kwargs...)
end

function get_r_hat_numerically(Kdede, Kdenu; positive=true, normalisation=true)
Expand Down

0 comments on commit 3fef39c

Please sign in to comment.