KeelinDerivZeros
New to Analytica 6.6
This is an esoteric function, hence it starts with an underscore. It is most likely to be of use for people who are studying the mathematics of or extending the Metalog distribution.
The algorithm here plays a central role in the air-tight algorithm for testing whether an a-coefficient vector is feasible, which was introduced in [Baucells, Chrisman, Keelin and Xu, 2025].
Function _KeelinDerivZeros( a, K, nth, resultIndex )
Finds the zeros (roots) of the «nth» derivative of the quantile function of the Keelin (MetaLog) distribution. It returns the roots even when the quantile is not feasible.
The second return value provides coefficients for a closed form function for the nth derivative as a function of [math]\displaystyle{ y }[/math].
Parameters
- «a»: The coefficient vector, indexed by «K».
- «K»: The basis index (i.e., index of the coefficients).
- «nth»: The desired derivative order
- «resultIndex»: The index to be used for the resulting zeros. If this index is not long enough to hold all the zeros, only the number of roots that fit are returned. This defaults to «K» if omitted, which is not always long enough. (twice the length of K is pretty safe).
Return values
- The primary return value is a vector indexed by «resultIndex» containing the zeros (roots).
- The second return value are the coefficients of [math]\displaystyle{ s^(n)(y) }[/math] indexed by K.
To graph the nth derivative, first create an index:
Index p := Sequence(1m, 1-1m, 1m)
Then compute the derivative on that index:
Local (roots, an) := _KeelinDerivZeros( a, K, nth ); CumKeelinFromA( p, an, K)]] / ( y * (1-y) )
Let [math]\displaystyle{ G^{(n)}(y) = y (1-y) M^{(n)}(y) }[/math], where [math]\displaystyle{ M(y) }[/math] is the Metalog quantile function (i.e., CumKeelin) and
- [math]\displaystyle{ M^{(n)}(y) = {{\partial M(y)}\over{\partial y}} }[/math]
It turns out that [math]\displaystyle{ G^{(n)}(y) }[/math] can be written in the same functional form as the Metalog quantile function, i.e., in the form:
- [math]\displaystyle{ G^{(n)}(y) = s(y) logit(y) + \mu(y) }[/math]
where [math]\displaystyle{ s(y) }[/math] and [math]\displaystyle{ \mu(y) }[/math] are polynomials. The function returns the coefficients for these polynomials in the second return value using the same coefficient ordering as used by Metalog 2.0.
Enable comment auto-refresher