sbi.diagnostics.calc_misspecification_logprob

sbi.diagnostics.calc_misspecification_logprob#

calc_misspecification_logprob(x_val, x_o, estimator, alpha=0.05)[source]#

Perform hypothesis test to check if estimator.log_prob(x_o) is unusually low.

The estimator.log_prob(x_o) logcompared to the log probabilities of samples in x_val. First it performs a c2st check of the estimator using x_val, and warns the user if c2st is poor as test results might not be meaningful.

Parameters:
  • x_val (Tensor) – array-like, known samples to compute baseline logprobs

  • x_o (Tensor) – array-like, the test sample or the obervation

  • estimator (UnconditionalDensityEstimator) – marginal distribution estimator

  • alpha (float) – significance level (default 0.05)

Returns:

float, proportion of log_probs below log_prob_xo - reject_H0: bool, whether to reject H0 at the given alpha level

Return type:

  • p_value