flexcode.loss_functions

Module Contents

Functions

cde_loss(cde_estimates, z_grid, true_z)

Calculates conditional density estimation loss on holdout data

cde_loss(cde_estimates, z_grid, true_z)[source]

Calculates conditional density estimation loss on holdout data

@param cde_estimates: a numpy array where each row is a density estimate on z_grid @param z_grid: a numpy array of the grid points at which cde_estimates is evaluated @param true_z: a numpy array of the true z values corresponding to the rows of cde_estimates

@returns The CDE loss (up to a constant) for the CDE estimator on the holdout data