| Title: | Local Influence Diagnostics for the Extreme-Value Birnbaum-Saunders Regression Model |
|---|---|
| Description: | Implements local influence diagnostics for the Extreme-Value Birnbaum-Saunders (EVBS) regression model: joint maximum likelihood estimation, conformal normal curvature diagnostics under three perturbation schemes (case-weight, response variable, and explanatory variable), randomized quantile residuals with simulation envelope, Monte Carlo simulation utilities, and publication-quality density and diagnostic plots. The methods are described in Ospina, Lima, Barros, and Macedo (2026, submitted) and are applied to monthly maximum wind gust data from Itajai, Brazil. |
| Authors: | Raydonal Ospina [aut, cre] (ORCID: <https://orcid.org/0000-0002-9884-9090>) |
| Maintainer: | Raydonal Ospina <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.0 |
| Built: | 2026-07-01 07:32:11 UTC |
| Source: | https://github.com/cran/evbsreg |
Computes conformal normal curvature (CNC) local influence diagnostics
from a fitted EVBS regression model. The CNC approach of Poon and Poon
(1999) produces a scale-invariant influence measure bounded in
; the aggregate contribution statistic of Zhu and Lee (2001)
attributes curvature to individual observations and is compared against
interpretable reference thresholds.
cnc_diagnostics(fit)cnc_diagnostics(fit)
fit |
A fitted model object returned by |
The function performs the symmetric eigendecomposition of the influence
matrix , normalizes the eigenvalues to unit norm, and for each
threshold identifies the -influential
eigenvectors (those whose normalized eigenvalue exceeds
). The aggregate contribution of observation at
level , , is the sum of the normalized eigenvalues
weighted by the squared eigenvector coordinates of observation .
A list with components:
eigenvaluesNumeric vector: the raw eigenvalues of
.
eigenvalues_normNumeric vector: the absolute normalized
eigenvalues .
eigenvectorsMatrix: the eigenvectors of
(columns).
thresholdsNumeric vector of length 7: the reference
thresholds for .
BjMatrix of dimension : rows 1–7 hold
the aggregate contributions for ;
row 8 holds the global aggregate over all eigenvectors.
bqNumeric vector of length 8: the reference values
for flagging influential observations at each level.
nInteger: the sample size.
Poon, W.-Y. and Poon, Y. S. (1999). Conformal normal curvature and assessment of local influence. Journal of the Royal Statistical Society, Series B, 61, 51–61.
Zhu, H. and Lee, S. (2001). Local influence for incomplete-data models. Journal of the Royal Statistical Society, Series B, 63, 111–126.
Ospina, R., Lima, J. I. C., Barros, M., and Macedo, A. M. S. (2026). Local influence diagnostics for the extreme-value Birnbaum-Saunders regression model. Submitted.
data(itajai) X <- cbind(1, itajai$pressure) fit <- evbsreg.fit(X, itajai$wind) diag <- cnc_diagnostics(fit) ## Top normalized eigenvalues head(diag$eigenvalues_norm, 4) ## Observations flagged at q = 7 which(diag$Bj[7, ] > diag$bq[7])data(itajai) X <- cbind(1, itajai$pressure) fit <- evbsreg.fit(X, itajai$wind) diag <- cnc_diagnostics(fit) ## Top normalized eigenvalues head(diag$eigenvalues_norm, 4) ## Observations flagged at q = 7 which(diag$Bj[7, ] > diag$bq[7])
Produces a normal probability (QQ) plot of the randomized quantile residuals together with a simulated envelope, reproducing the residual diagnostic figure of the paper. Points falling outside the envelope indicate poor fit.
envelope_qq(X, t, nrep = 100)envelope_qq(X, t, nrep = 100)
X |
A numeric design matrix with an intercept column. |
t |
A numeric vector of strictly positive responses. |
nrep |
Number of simulated samples used to build the envelope
(default |
Invisibly, a list with components r (observed residuals),
e1 and e2 (lower and upper envelope bounds), and
med (envelope median). A base-graphics plot is produced as a
side effect.
Atkinson, A. C. (1985). Plots, Transformations and Regression. Oxford University Press.
data(itajai) X <- cbind(1, itajai$pressure) envelope_qq(X, itajai$wind, nrep = 100)data(itajai) X <- cbind(1, itajai$pressure) envelope_qq(X, itajai$wind, nrep = 100)
Fits the log-Extreme-Value Birnbaum-Saunders (log-EVBS) regression model
by joint maximum likelihood estimation. All parameters
are estimated simultaneously
using the BFGS algorithm with an analytic score function. Standard
errors are computed from the analytic observed Fisher information
matrix, which is numerically stable even for ill-conditioned design
matrices.
evbsreg.fit(x, t)evbsreg.fit(x, t)
x |
A numeric design matrix of dimension |
t |
A numeric vector of length |
The EVBS regression model links the location parameter of the log-EVBS
distribution to a linear predictor . The
shape parameter controls dispersion and the tail-shape
parameter governs the Generalized Extreme Value tail
behaviour (Frechet for , Gumbel for ,
Weibull for ).
Initial values are obtained from lm.fit applied to
the log response, together with the moment-based starting point
and . Optimization uses optim
with method = "BFGS", the analytic score, and tolerance
reltol = 1e-12.
The observed Fisher information is assembled analytically (see the
package vignette and the paper's appendix) and inverted via a Cholesky
factorization, falling back to solve if the matrix is not
positive definite.
A list of class "evbsreg" with components:
coeffNumeric vector of length : the full
parameter vector .
betahatNumeric vector of length : the regression
coefficients.
alphahatScalar: the estimated shape parameter
.
gamahatScalar: the estimated tail-shape parameter
.
stderrorsNumeric vector of length : standard
errors of the regression coefficients.
stderroralphaScalar: standard error of .
stderrorgamaScalar: standard error of .
zstatsNumeric vector: Wald z-statistics for the regression coefficients.
pvaluesNumeric vector: two-sided p-values for the regression coefficients.
muhatNumeric vector of length : fitted linear
predictor on the log scale.
xi1, xi2
Numeric vectors of length : helper
quantities evaluated at the MLE.
observmatrixNumeric matrix of dimension
: the analytic Hessian
of the log-likelihood (negative definite
at the maximum).
hessianNumeric matrix: identical to
observmatrix; provided under the conventional name. The
observed Fisher information is -hessian.
invNumeric matrix of dimension :
the inverse of the observed Fisher information -hessian, i.e.
the asymptotic variance-covariance matrix of .
BNumeric matrix of dimension : the
influence matrix for
the case-weight perturbation scheme, consumed by
cnc_diagnostics.
nobsInteger: the number of observations .
nparInteger: the number of parameters .
The returned object has class "evbsreg" and has a
print.evbsreg method that displays a coefficient table.
Ospina, R., Lima, J. I. C., Barros, M., and Macedo, A. M. S. (2026). Local influence diagnostics for the extreme-value Birnbaum-Saunders regression model: methodology, validation, and application to anomalous wind gusts. Submitted.
Leiva, V., Ferreira, M., Gomes, M. I., and Lillo, C. (2016). Extreme value Birnbaum-Saunders regression models applied to environmental data. Stochastic Environmental Research and Risk Assessment, 30, 1045–1058.
Cook, R. D. (1986). Assessment of local influence. Journal of the Royal Statistical Society, Series B, 48, 133–169.
cnc_diagnostics for influence diagnostics,
rqrandomized for residuals, itajai for the
example dataset.
data(itajai) X <- cbind(1, itajai$pressure) fit <- evbsreg.fit(X, itajai$wind) ## Parameter estimates and standard errors round(fit$coeff, 4) round(c(fit$stderrors, fit$stderroralpha, fit$stderrorgama), 4)data(itajai) X <- cbind(1, itajai$pressure) fit <- evbsreg.fit(X, itajai$wind) ## Parameter estimates and standard errors round(fit$coeff, 4) round(c(fit$stderrors, fit$stderroralpha, fit$stderrorgama), 4)
Runs a Monte Carlo simulation that evaluates the finite-sample properties of the joint maximum likelihood estimator of the EVBS regression model under one of three scenarios.
evbsreg.fit.mc( m, n, beta0, beta1, alpha, gama, scenario = c("canonical", "leverage", "robustness"), semente = 2023 )evbsreg.fit.mc( m, n, beta0, beta1, alpha, gama, scenario = c("canonical", "leverage", "robustness"), semente = 2023 )
m |
Number of Monte Carlo replicates (the paper uses |
n |
Sample size for each replicate (the paper uses 60, 120, 180). |
beta0 |
True intercept |
beta1 |
True slope |
alpha |
True shape parameter |
gama |
True tail-shape parameter |
scenario |
Character string selecting the design:
|
semente |
Integer RNG seed for reproducibility (default
|
A numeric matrix of dimension . Columns are the
four parameters Beta0, Beta1, Alpha, Gama;
rows are: Parametro (true value), EMV (mean estimate),
VIES-ABS (absolute bias), VIES-REL (relative bias),
VAR (empirical variance), EQM (mean squared error),
E-PADRAO (empirical standard error), EP-FISHER (mean
Fisher standard error), RAIZ-EQM (root mean squared error), and
TAXA-COB (empirical 95% coverage rate).
Ospina, R., Lima, J. I. C., Barros, M., and Macedo, A. M. S. (2026). Local influence diagnostics for the extreme-value Birnbaum-Saunders regression model. Submitted.
## Quick check with m = 50 replicates res <- evbsreg.fit.mc(m = 50, n = 60, beta0 = 0.5, beta1 = 0.5, alpha = 0.5, gama = 0.20, scenario = "canonical") print(res)## Quick check with m = 50 replicates res <- evbsreg.fit.mc(m = 50, n = 60, beta0 = 0.5, beta1 = 0.5, alpha = 0.5, gama = 0.20, scenario = "canonical") print(res)
Computes pairs of the Extreme-Value Birnbaum-Saunders
(EVBS) density over its support, for given parameters.
generate_evbs_data(alpha, beta, gama)generate_evbs_data(alpha, beta, gama)
alpha |
Shape parameter |
beta |
Scale parameter |
gama |
Tail-shape parameter |
A data.frame with columns t (support points) and
y (density values).
Ferreira, M., Gomes, M. I., and Leiva, V. (2012). On an extreme value version of the Birnbaum-Saunders distribution. REVSTAT, 10, 181–210.
plot_evbs_alpha, generate_logevbs_data.
d <- generate_evbs_data(alpha = 0.5, beta = 1, gama = 0.5) plot(d$t, d$y, type = "l", xlab = "t", ylab = "f(t)")d <- generate_evbs_data(alpha = 0.5, beta = 1, gama = 0.5) plot(d$t, d$y, type = "l", xlab = "t", ylab = "f(t)")
Computes pairs of the log-EVBS density over its support,
for given parameters.
generate_logevbs_data(alpha, eta, gama)generate_logevbs_data(alpha, eta, gama)
alpha |
Shape parameter |
eta |
Location parameter |
gama |
Tail-shape parameter |
A data.frame with columns y_vals (support points)
and fdp (density values).
Leiva, V., Ferreira, M., Gomes, M. I., and Lillo, C. (2016). Extreme value Birnbaum-Saunders regression models applied to environmental data. Stochastic Environmental Research and Risk Assessment, 30, 1045–1058.
plot_logevbs_alpha, generate_evbs_data.
d <- generate_logevbs_data(alpha = 1, eta = 0, gama = 0.5) plot(d$y_vals, d$fdp, type = "l", xlab = "y", ylab = "f(y)")d <- generate_logevbs_data(alpha = 1, eta = 0, gama = 0.5) plot(d$y_vals, d$fdp, type = "l", xlab = "y", ylab = "f(y)")
Monthly maximum wind gust speed and the daily mean atmospheric pressure
on the day of each maximum, recorded at INMET station A-868
(latitude , longitude ) in
Itajai, Santa Catarina, Brazil, from July 2010 to October 2020.
itajaiitajai
A data frame with 124 rows and 3 variables:
Integer index of the monthly observation (1 = July 2010, ..., 124 = October 2020).
Numeric. Monthly maximum wind gust speed (m/s).
Numeric. Daily mean atmospheric pressure (mb) on the day of the monthly maximum.
Observation 82 corresponds to the catastrophic event of April 26, 2017 (wind = 33.9 m/s), a severe cold front that struck the coast of Santa Catarina, with fatalities reported by local civil-defense authorities. This observation is identified as highly influential on the tail-shape parameter by the diagnostics implemented in this package.
Instituto Nacional de Meteorologia (INMET), Brazil. Data access: https://www.inmet.gov.br/
Ospina, R., Lima, J. I. C., Barros, M., and Macedo, A. M. S. (2026). Local influence diagnostics for the extreme-value Birnbaum-Saunders regression model. Submitted.
data(itajai) str(itajai) plot(itajai$pressure, itajai$wind, pch = 16, col = "darkgreen", xlab = "Pressure (mb)", ylab = "Wind gust (m/s)")data(itajai) str(itajai) plot(itajai$pressure, itajai$wind, pch = 16, col = "darkgreen", xlab = "Pressure (mb)", ylab = "Wind gust (m/s)")
Produces panel (b) of the diagnostic figure: the aggregate contributions
of each observation, with a horizontal reference line at
and automatic labelling of the most influential points.
plot_aggregate_contributions( diag, q = 7, label.flagged = 5, pch = 16, cex = 0.7, main = "" )plot_aggregate_contributions( diag, q = 7, label.flagged = 5, pch = 16, cex = 0.7, main = "" )
diag |
A list returned by |
q |
Integer influence threshold in |
label.flagged |
Number of largest observations to label. |
pch |
Plotting character (default |
cex |
Point size expansion (default |
main |
Plot title (default empty). |
The indices of the labelled observations, returned invisibly. Also produces a base-graphics plot as a side effect.
data(itajai) fit <- evbsreg.fit(cbind(1, itajai$pressure), itajai$wind) diag <- cnc_diagnostics(fit) plot_aggregate_contributions(diag, q = 7, main = "(b)")data(itajai) fit <- evbsreg.fit(cbind(1, itajai$pressure), itajai$wind) diag <- cnc_diagnostics(fit) plot_aggregate_contributions(diag, q = 7, main = "(b)")
Produces the two-panel diagnostic figure of the paper: normalized
eigenvalues (left) and aggregate contributions (right),
side by side.
plot_cnc(diag, q = 7, label.flagged = 5)plot_cnc(diag, q = 7, label.flagged = 5)
diag |
A list returned by |
q |
Integer influence threshold in |
label.flagged |
Number of largest observations to label in the
right panel (default |
Called for its side effect (a two-panel base-graphics figure).
Returns NULL invisibly.
cnc_diagnostics,
plot_normalized_eigenvalues,
plot_aggregate_contributions.
data(itajai) fit <- evbsreg.fit(cbind(1, itajai$pressure), itajai$wind) diag <- cnc_diagnostics(fit) plot_cnc(diag, q = 7)data(itajai) fit <- evbsreg.fit(cbind(1, itajai$pressure), itajai$wind) diag <- cnc_diagnostics(fit) plot_cnc(diag, q = 7)
Reproduces Figure 1(a) of the paper: EVBS densities for
, ,
. Uses ggplot2 with the Dark2 colour palette.
plot_evbs_alpha()plot_evbs_alpha()
A ggplot object.
plot_evbs_gama, generate_evbs_data.
print(plot_evbs_alpha())print(plot_evbs_alpha())
Reproduces Figure 1(b) of the paper: EVBS densities for
, ,
. Uses ggplot2 with the Dark2 colour palette.
plot_evbs_gama()plot_evbs_gama()
A ggplot object.
print(plot_evbs_gama())print(plot_evbs_gama())
Reproduces Figure 2(a) of the paper: log-EVBS densities for
, , .
Uses ggplot2 with the Dark2 colour palette.
plot_logevbs_alpha()plot_logevbs_alpha()
A ggplot object.
print(plot_logevbs_alpha())print(plot_logevbs_alpha())
Reproduces Figure 2(b) of the paper: log-EVBS densities for
, ,
. Uses ggplot2 with the Dark2 colour palette.
plot_logevbs_gama()plot_logevbs_gama()
A ggplot object.
print(plot_logevbs_gama())print(plot_logevbs_gama())
Produces panel (a) of the diagnostic figure: the normalized eigenvalues
of the influence matrix, with horizontal reference thresholds for
.
plot_normalized_eigenvalues(diag, pch = 16, cex = 1, main = "")plot_normalized_eigenvalues(diag, pch = 16, cex = 1, main = "")
diag |
A list returned by |
pch |
Plotting character (default |
cex |
Point size expansion (default |
main |
Plot title (default empty). |
Called for its side effect (a base-graphics plot). Returns
NULL invisibly.
data(itajai) fit <- evbsreg.fit(cbind(1, itajai$pressure), itajai$wind) diag <- cnc_diagnostics(fit) plot_normalized_eigenvalues(diag, main = "(a)")data(itajai) fit <- evbsreg.fit(cbind(1, itajai$pressure), itajai$wind) diag <- cnc_diagnostics(fit) plot_normalized_eigenvalues(diag, main = "(a)")
Compactly prints the parameter estimates, standard errors, and Wald
tests of an object returned by evbsreg.fit.
## S3 method for class 'evbsreg' print(x, digits = 4, ...)## S3 method for class 'evbsreg' print(x, digits = 4, ...)
x |
An object of class |
digits |
Number of significant digits (default 4). |
... |
Further arguments passed to |
The object x, invisibly. Called for the side effect of
printing a coefficient table to the console.
data(itajai) fit <- evbsreg.fit(cbind(1, itajai$pressure), itajai$wind) print(fit)data(itajai) fit <- evbsreg.fit(cbind(1, itajai$pressure), itajai$wind) print(fit)
Computes Cox-Snell residuals for a log-EVBS regression fit. Under a correctly specified model these residuals form an approximately standard exponential sample.
rcoxsnell(X, t)rcoxsnell(X, t)
X |
A numeric design matrix with an intercept column. |
t |
A numeric vector of strictly positive responses. |
A numeric vector of length length(t) containing the
Cox-Snell residuals.
Cox, D. R. and Snell, E. J. (1968). A general definition of residuals. Journal of the Royal Statistical Society, Series B, 30, 248–275.
data(itajai) X <- cbind(1, itajai$pressure) cs <- rcoxsnell(X, itajai$wind) summary(cs)data(itajai) X <- cbind(1, itajai$pressure) cs <- rcoxsnell(X, itajai$wind) summary(cs)
Generates random variates from the Extreme-Value Birnbaum-Saunders (EVBS) distribution by transforming Generalized Extreme Value (GEV) variates.
revbs(n, alpha, beta, gama)revbs(n, alpha, beta, gama)
n |
Sample size (number of variates to generate). |
alpha |
Shape parameter |
beta |
Scale parameter |
gama |
Tail-shape parameter |
If , then
follows the EVBS distribution. GEV variates are drawn via
rgev from the SpatialExtremes package.
A numeric vector of n EVBS variates. Returns NA
if n is NA.
Ferreira, M., Gomes, M. I., and Leiva, V. (2012). On an extreme value version of the Birnbaum-Saunders distribution. REVSTAT, 10, 181–210.
set.seed(2023) x <- revbs(100, alpha = 0.5, beta = 1, gama = 0.2) summary(x)set.seed(2023) x <- revbs(100, alpha = 0.5, beta = 1, gama = 0.2) summary(x)
Computes randomized quantile residuals (Dunn and Smyth, 1996) for a log-EVBS regression fit. Under a correctly specified model these residuals are approximately standard normal, so departures from normality indicate lack of fit.
rqrandomized(X, t)rqrandomized(X, t)
X |
A numeric design matrix with an intercept column. |
t |
A numeric vector of strictly positive responses. |
A numeric vector of length length(t) containing the
randomized quantile residuals.
Dunn, P. K. and Smyth, G. K. (1996). Randomized quantile residuals. Journal of Computational and Graphical Statistics, 5, 236–244.
rcoxsnell, envelope_qq,
evbsreg.fit.
data(itajai) X <- cbind(1, itajai$pressure) r <- rqrandomized(X, itajai$wind) shapiro.test(r)data(itajai) X <- cbind(1, itajai$pressure) r <- rqrandomized(X, itajai$wind) shapiro.test(r)