MyNixOS website logo
Description

Bootstrap-Calibrated Goodness-of-Fit Test for Simplex Regression.

Implements the bootstrap-calibrated local-influence goodness-of-fit test for simplex regression models with constant or varying dispersion, following the local influence approach of Zhu and Zhang (2004) <doi:10.1093/biomet/91.3.579> and the simplex regression model of Barndorff-Nielsen and Jorgensen (1991) <doi:10.1016/0047-259X(91)90008-P>. The test statistic aggregates individual local-influence measures under case-weight perturbation. Because the first-order asymptotic normal calibration is severely liberal in finite samples, a parametric bootstrap calibration is provided that restores accurate size control and delivers high power against omitted covariates, neglected dispersion, and distributional misspecification. Plotting functions reproduce the figures and tables of the companion methodological paper. Computational kernels are implemented in 'C++' via 'Rcpp' and 'RcppArmadillo' for speed, and two real datasets are bundled.

simplexgof

R-CMD-check pkgdown License: GPL v3

Overview

simplexgof implements the bootstrap-calibrated local-influence goodness-of-fit (GoF) test for simplex regression models with constant or varying dispersion (Ospina, Espinheira, Silva and Barros, 2026).

The key finding of the companion paper is that the standard normal approximation to the null distribution of the test statistic $U_n$ is severely liberal in finite samples — empirical rejection rates under a correctly specified model range from 3 to 7 times the nominal level. A parametric bootstrap fully corrects this, while preserving high power.

The package also provides one-call functions to reproduce every table and figure from the paper.

Installation

# From GitHub
remotes::install_github("Raydonal/simplexgof")

Quick start

library(simplexgof)

# ── 1. Ammonia application (full paper reproduction) ──────────────
#       Reproduces Tables 5-6 and Figures 2-3 of Ospina et al. (2026)
set.seed(123)
res <- paper_ammonia(B = 1000)   # set B = 200 for a quick run

# Access individual components
print(res$table_params)          # Table 5: parameter estimates
print(res$table_gof)             # Table 6: GoF test results
plot_influence(res$diag)         # Figure 2: influence index plot
plot_gof_boot(res$gof)           # Figure 3: bootstrap distribution

# ── 2. Manual workflow ─────────────────────────────────────────────
data(ammonia)
X   <- cbind(1, ammonia$corr_ar, ammonia$temp_agua,
             ammonia$corr_ar * ammonia$temp_agua)
Z   <- cbind(1, ammonia$temp_agua,
             ammonia$corr_ar * ammonia$temp_agua)
fit <- simplex_fit(ammonia$perda, X, Z)   # fit model
dg  <- simplex_diag(fit)                  # compute U_n = 0.0298
gof <- simplex_gof(ammonia$perda, X, Z, B = 1000, seed = 123)
print(gof)

Output:

simplexgof: U_n = 0.0298  (Tn = 8.0447, B = 1000)

 alpha boot_lo boot_hi    decision_boot
   1%  -1.0028  0.0611 Do not reject H0
   5%  -0.7312  0.0405 Do not reject H0
  10%  -0.6320  0.0283        Reject H0

Functions at a glance

FunctionPurpose
simplex_fit()Fit simplex regression (MLE, logit + log link)
simplex_gof()Bootstrap GoF test; returns decisions at each α
simplex_diag()Individual influences C_{It}, T_n, U_n, J vector
plot_influence()Influence index plot (Figure 2 of paper)
plot_envelope()Half-normal plot with simulated envelope
plot_gof_boot()Bootstrap distribution of U_n (Figure 3 of paper)
paper_ammonia()Reproduce Tables 5–6 + Figures 2–3 in one call
paper_pbsc()Reproduce Tables 7–8 + Figures 4–5 in one call
rsimplex()Random generation from S⁻(μ, σ²)
sim_table1()Monte Carlo size/power study (Table 2 of paper)

Datasets

DatasetnDescription
ammonia21Ammonia oxidation, Brownlee (1965)
pbsc239CD34+ recovery rate, Edmonton Institute

The GoF test

$$U_n = \frac{\sqrt{n}\bigl[\sum_{t=1}^n C_{I_t}(\hat\theta) - 2k\bigr]}{s_{k,c}}$$

where $C_{I_t} = 2\Delta_t^\top(-\ddot\ell)^{-1}\Delta_t$ is the total local influence of observation $t$ under case-weight perturbation. Under $H_0$ (correct specification), $U_n \to N(0,1)$, but the bootstrap calibration is strongly preferred.

Citation

citation("simplexgof")

Package (cite as):

Ospina R. (2026). simplexgof: Bootstrap-Calibrated Goodness-of-Fit Test for Simplex Regression.
R package version 0.1.0. https://github.com/Raydonal/simplexgof

Companion article (methodology):

Ospina R., Espinheira P.L., Silva F.C., Barros M. (2026).
A Bootstrap-Calibrated Local Influence Goodness-of-Fit Procedure for
Simplex Regression Models.

References

  • Barndorff-Nielsen O.E., Jørgensen B. (1991). J. Multivariate Anal., 39, 106–116.
  • Brownlee K.A. (1965). Statistical Theory and Methodology. Wiley.
  • Zhu H., Zhang H. (2004). Biometrika, 91(3), 579–589.
Metadata

Version

0.1.0

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows