cdf

QRNN.cdf(x)[source]

Approximate the posterior CDF for given inputs x.

Propagates the inputs in x forward through the network and approximates the posterior CDF by a piecewise linear function.

The piecewise linear function is given by its values at approximate quantiles \(x_\tau\) for \(\tau = \{0.0, \tau_1, \ldots, \tau_k, 1.0\}\) where \(\tau_k\) are the quantiles to be estimated by the network. The values for \(x_{0.0}\) and \(x_{1.0}\) are computed using

\[ \begin{align}\begin{aligned}x_{0.0} = 2.0 x_{\tau_1} - x_{\tau_2}\\x_{1.0} = 2.0 x_{\tau_k} - x_{\tau_{k-1}}\end{aligned}\end{align} \]
Parameters

x (np.array) – Array of shape (n, m) containing n inputs for which to predict the conditional quantiles.

Returns

Tuple (xs, fs) containing the \(x\)-values in xs and corresponding values of the posterior CDF \(F(x)\) in fs.