Metalog Feasibility Checker
Checks whether a metalog coefficient vector defines a valid quantile function.
A metalog is a valid distribution exactly when its quantile function is strictly increasing, that is, when the quantile derivative is positive throughout the open interval from zero to one. This is a property of the fitted coefficients rather than a constraint that can be imposed on them in advance, so it has to be verified after the fact. Nothing about a data set guarantees that a least squares fit to it will be feasible.
For two and three terms the condition is available in closed form and the companion functions should be preferred. For four or more terms no closed form exists and the derivative is scanned on a grid. A uniform grid alone under-resolves the tails, which is where violations tend to hide, so the grid combines uniform interior spacing with geometric refinement approaching each endpoint.
Feasibility of the underlying metalog is necessary and sufficient for every member of the family, because each boundedness transform contributes a strictly positive density factor.
Parameters
the spacing of the uniform portion of the grid, which must be in (0, 0.5)
how many powers of ten of refinement to add approaching each endpoint
Functions
Scans the grid and reports the smallest quantile derivative found along with where it occurred. Unlike isFeasible, this always performs the scan, so it can be used to inspect how much margin a feasible fit has.
A defensive copy of the probabilities at which the derivative is evaluated.
True when the supplied coefficients define a valid quantile function. Two- and three-term coefficient vectors take the exact closed-form route.