| 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. Version 1.1.0 adds the density, distribution and quantile functions, the finite upper endpoint, return levels and expected shortfall, block bootstrap standard errors for serially dependent series, local influence diagnostics for the generalized extreme-value regression model, and a GAMLSS family allowing the tail-shape parameter to depend on covariates. Version 1.2.0 adds a prospective control chart for endpoint identifiability. 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 <raydonal@de.ufpe.br> |
| License: | MIT + file LICENSE |
| Version: | 1.2.1 |
| Built: | 2026-10-09 21:24:13 UTC |
| Source: | https://github.com/raydonal/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])
Local influence diagnostics under case-weight perturbation for the GEV
regression model, obtained from the individual score contributions (see
gev_scores) and the observed information.
cnc_diagnostics_gev(object)cnc_diagnostics_gev(object)
object |
An object of class |
A list with Bj, the diagonal of the influence matrix
normalised to sum to one, the threshold 2/n, the indices of the
observations with Bj above it, and Bbar, the mean aggregate
contribution over the thresholds and the
unthresholded contribution, computed exactly as
colMeans(cnc_diagnostics(fit)$Bj) is for the EVBS model. Use
Bbar when comparing influence rankings with the EVBS fit.
data(itajai) X <- cbind(1, itajai$pressure - mean(itajai$pressure)) fit <- gevreg.fit(X, itajai$wind) d <- cnc_diagnostics_gev(fit) head(order(d$Bj, decreasing = TRUE))data(itajai) X <- cbind(1, itajai$pressure - mean(itajai$pressure)) fit <- gevreg.fit(X, itajai$wind) d <- cnc_diagnostics_gev(fit) head(order(d$Bj, decreasing = TRUE))
Probability density function of the EVBS distribution on the response
(positive) scale. The EVBS variate satisfies
.
devbs(t, eta, alpha, gama, log = FALSE)devbs(t, eta, alpha, gama, log = FALSE)
t |
Vector of positive quantiles. |
eta |
Location on the log scale, typically |
alpha |
Positive shape (scale) parameter. |
gama |
Extreme-value shape parameter. |
log |
Logical; if |
The response lies in the same max-domain of attraction as the
GEV variate. Its extreme-value index is when ,
because in the upper tail, and
itself when : near a finite endpoint the
transformation is locally linear (Ferreira, Gomes and Leiva, 2012,
Theorems 4.1 and 4.2).
A numeric vector of (log-)density values.
devbs(c(10, 20, 30), eta = 2.58, alpha = 0.19, gama = -0.16)devbs(c(10, 20, 30), eta = 2.58, alpha = 0.19, gama = -0.16)
Density of the log-EVBS distribution (GAMLSS parametrization)
dlogEVBS(x, mu = 0, sigma = 1, nu = 0, log = FALSE) plogEVBS(q, mu = 0, sigma = 1, nu = 0, lower.tail = TRUE, log.p = FALSE) qlogEVBS(p, mu = 0, sigma = 1, nu = 0, lower.tail = TRUE, log.p = FALSE)dlogEVBS(x, mu = 0, sigma = 1, nu = 0, log = FALSE) plogEVBS(q, mu = 0, sigma = 1, nu = 0, lower.tail = TRUE, log.p = FALSE) qlogEVBS(p, mu = 0, sigma = 1, nu = 0, lower.tail = TRUE, log.p = FALSE)
x, q, p
|
Vector of quantiles / probabilities. |
mu |
Location on the log scale. |
sigma |
Positive scale parameter. |
nu |
Extreme-value shape parameter. |
log, log.p
|
Logical; return the log-density / log-probability. |
lower.tail |
Logical; if |
A numeric vector.
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)
Nonparametric moving-block bootstrap for the parameters of the EVBS regression model. Intended for series with residual serial dependence, where the standard errors obtained from the observed information under the independence assumption are optimistic.
evbs_block_boot(X, y, L = 4, B = 500)evbs_block_boot(X, y, L = 4, B = 500)
X |
Design matrix (including the intercept column). |
y |
Response vector. |
L |
Block length. |
B |
Number of bootstrap resamples. |
A list with the bootstrap standard errors and the matrix of bootstrap estimates.
data(itajai) evbs_block_boot(cbind(1, itajai$pressure), itajai$wind, L = 4, B = 100)$sedata(itajai) evbs_block_boot(cbind(1, itajai$pressure), itajai$wind, L = 4, B = 100)$se
When the EVBS lies in the Weibull max-domain of attraction
and its support is bounded above. The endpoint is the largest response the
fitted model regards as possible, and is therefore the quantity of primary
interest in design applications. It is also highly sensitive to individual
observations, which is what the local influence diagnostics in this package
are designed to detect.
evbs_endpoint(eta, alpha, gama)evbs_endpoint(eta, alpha, gama)
eta |
Location on the log scale, typically |
alpha |
Positive shape (scale) parameter. |
gama |
Extreme-value shape parameter. |
The finite upper endpoint, or Inf when .
evbs_endpoint(eta = 2.58, alpha = 0.19, gama = -0.16) evbs_endpoint(eta = 2.58, alpha = 0.19, gama = 0.10) # Infevbs_endpoint(eta = 2.58, alpha = 0.19, gama = -0.16) evbs_endpoint(eta = 2.58, alpha = 0.19, gama = 0.10) # Inf
Computes the monitoring index that combines the conformal normal
curvature diagnostic with the finite upper endpoint of the fitted model. The
index compares the support the model would infer without the observation
flagged by the curvature against the largest response actually observed.
evbs_monitor(X, y, burn = 40, use = c("curvature", "max"))evbs_monitor(X, y, burn = 40, use = c("curvature", "max"))
X |
Design matrix (including the intercept column). |
y |
Response vector, in time order. |
burn |
Number of initial observations before the index is first computed. |
use |
Either |
Let be the observation with the largest aggregate contribution
when the model is fitted to the first records, and
the largest response up to . Then
where is the endpoint estimated after deleting the
flagged observation, evaluated at the covariate value of the observation
that attains , so that numerator and denominator refer to
the same covariate value. The flagged observation is the one with the
largest mean aggregate contribution, colMeans(cnc_diagnostics(fit)$Bj).
See gev_monitor for the same index under the GEV regression.
Values below one indicate that the model fitted without the flagged observation assigns probability zero to a value that was in fact observed: the endpoint is then determined by a single record and should not be quoted as a design value. The control limit at one follows from the definition and is not a tuning constant.
Deleting the sample maximum instead of the flagged observation (use =
"max") lowers the endpoint essentially by construction and produces an index
that signals almost everywhere; it is provided for comparison only.
A data frame with the time index, the running maximum, the flagged
observation, the fitted shape parameter and the index F.
data(itajai) ct <- evbs_monitor(cbind(1, itajai$pressure), itajai$wind, burn = 40) plot(ct$t, ct$F, type = "l"); abline(h = 1, lty = 2)data(itajai) ct <- evbs_monitor(cbind(1, itajai$pressure), itajai$wind, burn = 40) plot(ct$t, ct$F, type = "l"); abline(h = 1, lty = 2)
Computes the period-observation return level and, optionally, the
conditional tail expectation (expected shortfall) at a given linear
predictor value.
evbs_return_level(object, x, period, es = FALSE)evbs_return_level(object, x, period, es = FALSE)
object |
An object of class |
x |
Covariate vector (including the intercept) at which to evaluate. |
period |
Return period, expressed in the units of one observation. For
monthly maxima and a |
es |
Logical; if |
The return level is the quantile of order of the
fitted conditional distribution of one observation at covariate
value x: it is exceeded on average once in period
observations with that covariate value, not a return level of the marginal
distribution. With monthly maxima, period = 12 * T gives the level
exceeded once in months; reading it as the -year level of
the annual maximum assumes the monthly maxima of a year are independent.
Periods much longer than the record are extrapolations.
A named numeric vector with the return level and, if requested, the expected shortfall.
data(itajai) fit <- evbsreg.fit(cbind(1, itajai$pressure), itajai$wind) # 50-year return level at mean pressure, from monthly maxima evbs_return_level(fit, x = c(1, mean(itajai$pressure)), period = 12 * 50, es = TRUE)data(itajai) fit <- evbsreg.fit(cbind(1, itajai$pressure), itajai$wind) # 50-year return level at mean pressure, from monthly maxima evbs_return_level(fit, x = c(1, mean(itajai$pressure)), period = 12 * 50, es = TRUE)
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)")
The index of evbs_monitor, computed with the GEV
regression of gevreg.fit in place of the EVBS model. At each
burn the model is fitted to the first records,
the observation with the largest mean aggregate contribution
(cnc_diagnostics_gev(fit)$Bbar) is deleted, the model is refitted,
and the endpoint of the refit, evaluated at the
covariate value of the running maximum, is divided by the running maximum.
The endpoint is infinite, and so is the index, when the refitted
is not negative.
gev_monitor(X, y, burn = 40, use = c("curvature", "max"))gev_monitor(X, y, burn = 40, use = c("curvature", "max"))
X |
Design matrix (including the intercept column). Centre the covariates: the GEV likelihood is poorly conditioned otherwise. |
y |
Response vector, in time order. |
burn |
Number of initial observations before the index is first computed. |
use |
Either |
A data frame of class evbs_monitor with the time index, the
running maximum, the flagged observation, the fitted shape parameter
xi, the endpoint and the index F. Instants at which a fit
fails or does not converge are omitted.
data(itajai) X <- cbind(1, itajai$pressure - mean(itajai$pressure)) gt <- gev_monitor(X, itajai$wind, burn = 40) plot(gt)data(itajai) X <- cbind(1, itajai$pressure - mean(itajai$pressure)) gt <- gev_monitor(X, itajai$wind, burn = 40) plot(gt)
Returns the matrix whose th row is the score vector of the th
observation, , for the
generalized extreme-value regression model with linear location,
and
.
gev_scores(y, X, beta, sigma, xi)gev_scores(y, X, beta, sigma, xi)
y |
Response vector. |
X |
Design matrix (including the intercept column). |
beta |
Regression coefficients for the location parameter. |
sigma |
Positive scale parameter. |
xi |
Extreme-value shape parameter. |
This matrix is the key to generalizing local influence diagnostics beyond a
single model class. Under the case-weight perturbation scheme the perturbed
log-likelihood is , so the perturbation matrix is
evaluated at the maximum likelihood estimate. That is, is simply
the matrix of individual score contributions. This holds for any
likelihood model, which is why the conformal normal curvature framework
requires nothing beyond the score and the observed information.
With , and
, the components are
An matrix of individual score contributions.
data(itajai) X <- cbind(1, itajai$pressure - mean(itajai$pressure)) fit <- gevreg.fit(X, itajai$wind) S <- gev_scores(itajai$wind, X, fit$beta, fit$sigma, fit$xi) colSums(S) # approximately zero at the MLEdata(itajai) X <- cbind(1, itajai$pressure - mean(itajai$pressure)) fit <- gevreg.fit(X, itajai$wind) S <- gev_scores(itajai$wind, X, fit$beta, fit$sigma, fit$xi) colSums(S) # approximately zero at the MLE
Fits with
by maximum likelihood, using the analytic
gradient and several starting values for the shape parameter.
gevreg.fit(X, y, xi_start = c(-0.2, -0.05, 0.05, 0.2))gevreg.fit(X, y, xi_start = c(-0.2, -0.05, 0.05, 0.2))
X |
Design matrix (including the intercept column). |
y |
Response vector. |
xi_start |
Vector of starting values for the shape parameter. |
Centring the covariates is strongly recommended: the GEV likelihood is poorly conditioned when covariates are far from the origin, and an uncentred fit may fail to converge without any warning.
A list with the estimates, the log-likelihood, the observed information (Hessian of the negative log-likelihood) and the convergence code.
data(itajai) X <- cbind(1, itajai$pressure - mean(itajai$pressure)) gevreg.fit(X, itajai$wind)data(itajai) X <- cbind(1, itajai$pressure - mean(itajai$pressure)) gevreg.fit(X, itajai$wind)
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)")
Defines the log-Extreme-Value Birnbaum-Saunders distribution as a
three-parameter gamlss family, so that each parameter may depend on
covariates through a linear predictor or a smooth term. This is the natural
way to let the tail-shape parameter vary with covariates, which the fixed
three-parameter fit of evbsreg.fit does not allow.
logEVBS(mu.link = "identity", sigma.link = "log", nu.link = "identity")logEVBS(mu.link = "identity", sigma.link = "log", nu.link = "identity")
mu.link |
Link for the location parameter |
sigma.link |
Link for the scale parameter |
nu.link |
Link for the extreme-value shape parameter |
The response is where follows the EVBS
distribution, so that
.
The parameter map is (identity link),
(log link, positive) and (identity
link, real-valued).
With a constant predictor the fitted reproduce the
of evbsreg.fit; this equivalence is
the recommended check after loading the family. The score and second-order
derivatives required by gamlss are obtained by automatic numerical
differentiation of the analytic log-density, which is exact to working
precision and avoids transcription error in the lengthy closed forms.
A gamlss.family object.
## Not run: library(gamlss) data(itajai) y <- log(itajai$wind) # constant model: should match evbsreg.fit on the log scale m0 <- gamlss(y ~ 1, family = logEVBS()) # tail shape depending on pressure: m1 <- gamlss(y ~ pressure, nu.formula = ~ pressure, data = itajai, family = logEVBS()) ## End(Not run)## Not run: library(gamlss) data(itajai) y <- log(itajai$wind) # constant model: should match evbsreg.fit on the log scale m0 <- gamlss(y ~ 1, family = logEVBS()) # tail shape depending on pressure: m1 <- gamlss(y ~ pressure, nu.formula = ~ pressure, data = itajai, family = logEVBS()) ## End(Not run)
Distribution function of the Extreme-Value Birnbaum-Saunders distribution
pevbs(t, eta, alpha, gama, lower.tail = TRUE)pevbs(t, eta, alpha, gama, lower.tail = TRUE)
t |
Vector of positive quantiles. |
eta |
Location on the log scale, typically |
alpha |
Positive shape (scale) parameter. |
gama |
Extreme-value shape parameter. |
lower.tail |
Logical; if |
A numeric vector of probabilities.
pevbs(30, eta = 2.58, alpha = 0.19, gama = -0.16, lower.tail = FALSE)pevbs(30, eta = 2.58, alpha = 0.19, gama = -0.16, lower.tail = FALSE)
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)")
Plot an endpoint-identifiability control chart
## S3 method for class 'evbs_monitor' plot(x, ...)## S3 method for class 'evbs_monitor' plot(x, ...)
x |
An object returned by |
... |
Further arguments passed to |
Called for its side effect; invisibly returns x.
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)
Exact quantile function on the response scale. This is the function needed to compute return levels; the generalized extreme-value return-level formula does not apply to the EVBS response, since the response is a monotone transformation of a GEV variate rather than a GEV variate itself.
qevbs(p, eta, alpha, gama)qevbs(p, eta, alpha, gama)
p |
Vector of probabilities in |
eta |
Location on the log scale, typically |
alpha |
Positive shape (scale) parameter. |
gama |
Extreme-value shape parameter. |
A numeric vector of quantiles.
# 50-year return level from monthly maxima: p = 1 - 1/(12*50) qevbs(1 - 1 / 600, eta = 2.58, alpha = 0.19, gama = -0.16)# 50-year return level from monthly maxima: p = 1 - 1/(12*50) qevbs(1 - 1 / 600, eta = 2.58, alpha = 0.19, gama = -0.16)
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)