German Credit Hierarchical Logistic Distribution

class pints.toy.GermanCreditHierarchicalLogPDF(x=None, y=None, download=False)[source]

Toy distribution based on a hierarchical logistic regression model, which takes the form,

\[f(z, y|\beta) \propto \text{exp}(-\sum_{i=1}^{N} \text{log}(1 + \text{exp}(-y_i z_i.\beta)) - \beta.\beta/2\sigma^2 - N/2 \text{log }\sigma^2 - \lambda \sigma^2)\]

The data \((z, y)\) are a matrix of individual predictors (with 1s in the first column) and responses (1 if the individual should receive credit and -1 if not) respectively; \(\beta\) is a 325x1 vector of coefficients and \(N=1000\); \(z\) is the design matrix formed by creating all interactions between individual variables and themselves as defined in [2].

Extends pints.LogPDF.

Parameters:

theta (float) – vector of coefficients of length 326 (first dimension is sigma; other entries make up beta)

References

data()[source]

Returns data used to fit model: x, y and z.

distance(samples)

Calculates a measure of distance from samples to some characteristic of the underlying distribution.

evaluateS1(theta)[source]

See LogPDF.evaluateS1().

n_parameters()[source]

Returns the dimension of the space this LogPDF is defined over.

sample(n_samples)

Generates independent samples from the underlying distribution.

suggested_bounds()[source]

See ToyLogPDF.suggested_bounds().