Given a fitted simplex regression model, computes all quantities needed for the \(U_n\) goodness-of-fit statistic: the \(C_{I_t}\) influence measures, \(T_n\), the J gradient vector, and the individual \(k_t\) terms that estimate the asymptotic variance of \(T_n / \sqrt{n}\).
Usage
simplex_diag(fit, J.method = c("analytic", "finitediff"))Arguments
- fit
An object of class
"simplexfit"returned bysimplex_fit.- J.method
Method used to compute the J gradient vector: either
"analytic"(default) for the closed-form expression, or"finitediff"for a numerical finite-difference approximation.
Value
A list with components:
TnThe numerator of \(U_n\): \(\sqrt{n}(\sum C_{I_t} - 2k)\).
UnThe test statistic \(T_n / s_{k,c}\).
CeiNumeric vector of length n: individual influence values.
J_vecGradient vector of \(\text{tr}(H_{LD})\) w.r.t. \(\theta\).
k_vecNumeric vector of length n: the \(k_t\) terms.
A_star, B_star, A_star_invEstimated matrices.
DeltaPerturbation matrix (k x n).
Hessiana, inv_obs, inv_fisherMatrices from the fit.
Details
The J vector is computed using the analytic closed-form expressions derived in the article (Ox-compatible implementation). These analytic expressions are faster than numerical differentiation and produce the same test decisions as the original Ox reference implementation.
