# pymc.OrderedProbit#

class pymc.OrderedProbit(name, *args, compute_p=True, **kwargs)[source]#

Wrapper class for Ordered Probit distributions.

Useful for regression on ordinal data values whose values range from 1 to K as a function of some predictor, $$\eta$$. The cutpoints, $$c$$, separate which ranges of $$\eta$$ are mapped to which of the K observed dependent variables. The number of cutpoints is K - 1. It is recommended that the cutpoints are constrained to be ordered.

In order to stabilize the computation, log-likelihood is computed in log space using the scaled error function erfcx.

$\begin{split}f(k \mid \eta, c) = \left\{ \begin{array}{l} 1 - \text{normal_cdf}(0, \sigma, \eta - c_1) \,, \text{if } k = 0 \\ \text{normal_cdf}(0, \sigma, \eta - c_{k - 1}) - \text{normal_cdf}(0, \sigma, \eta - c_{k}) \,, \text{if } 0 < k < K \\ \text{normal_cdf}(0, \sigma, \eta - c_{K - 1}) \,, \text{if } k = K \\ \end{array} \right.\end{split}$
Parameters
eta

The predictor.

cutpointstensor_like array of floats

The length K - 1 array of cutpoints which break $$\eta$$ into ranges. Do not explicitly set the first and last elements of $$c$$ to negative and positive infinity.

sigmatensor_like of float, default 1.0

Standard deviation of the probit function.

compute_pbool, default True

Whether to compute and store in the trace the inferred probabilities of each categories, based on the cutpoints’ values. Defaults to True. Might be useful to disable it if memory usage is of interest.

Methods

 OrderedProbit.__init__(*args, **kwargs) OrderedProbit.dist(*args, **kwargs)