Skip to content

Instantly share code, notes, and snippets.

@ThomasParistech
Last active February 26, 2024 17:35
Show Gist options
  • Save ThomasParistech/9aa9dab93f214b9fd60be42ab1dee979 to your computer and use it in GitHub Desktop.
Save ThomasParistech/9aa9dab93f214b9fd60be42ab1dee979 to your computer and use it in GitHub Desktop.
import numpy as np
from scipy.special import logit
def transformed_kde(x_data: np.ndarray, x_prediction: np.ndarray) -> np.ndarray:
x_data_logit = logit(x_data)
x_prediction_logit = logit(x_prediction)
densities_logit = basic_kde(x_data_logit, x_prediction_logit)
return densities_logit / (x_prediction * (1.0-x_prediction))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment