unitquantreg
objectsProduces a (half-)normal probability plot from a fitted model
object of class unitquantreg
.
hnp(object, ...)# S3 method for unitquantreg
hnp(
object,
nsim = 99,
halfnormal = TRUE,
plot = TRUE,
output = TRUE,
level = 0.95,
resid.type = c("quantile", "cox-snell"),
...
)
A list with the following components in ordered
(and absolute if halfnormal
is TRUE
) values:
the observed residuals.
the theoretical residuals.
lower envelope band.
median envelope band.
upper envelope band.
time elapsed to fit the nsim
models.
fitted model object of class unitquantreg
.
currently not used.
number of simulations used to compute envelope. Default is 99.
logical. If TRUE
, a half-normal plot is produced.
If FALSE
, a normal plot is produced.
Should the (half-)normal plot be plotted? Default is TRUE
.
Should the output be returned? Default is TRUE
.
confidence level of the simulated envelope. Default is 0.95.
type of residuals to be used. The default is quantile
.
See residuals.unitquantreg
for further details.
André F. B. Menezes
Residuals plots with simulated envelope were proposed by Atkinson (1981) and can be construct as follows:
generate sample set of \(n\) independent observations from the estimated parameters of the fitted model;
fit the model using the generated sample, if halfnormal
is
TRUE
compute the absolute values of the residuals and arrange them in order;
repeat steps (1) and (2) nsim
number of times;
consider the \(n\) sets of the nsim
ordered statistics
of the residuals, then for each set compute the quantile level
/2,
the median and the quantile 1 - level
/2;
plot these values and the ordered residuals of the original sample set
versus the expected order statistics of a (half)-normal distribution,
which is approximated as
$$G^{-1} \left(\frac{i + n - 0.125}{2n + 0.5} \right)$$
for half-normal plots, i.e., halfnormal=TRUE
or
$$G^{-1} \left(\frac{i - 0.375}{n + 0.25}\right)$$
for normal plots, i.e., halfnormal=FALSE
, where \(G(\cdot)\) is the the
cumulative distribution function of standard Normal distribution for
quantile
residuals or the standard exponential distribution for the
cox-snell
residuals.
According to Atkinson (1981), if the model was correctly specified then no
more than level
100% of the observations are expected to appear
outside the envelope bands. Additionally, if a large proportion of the
observations lies outside the envelope, thus one has evidence against
the adequacy of the fitted model.
Atkinson, A. C., (1981). Two graphical displays for outlying and influential observations in regression. Biometrika 68(1), 13--20.
residuals.unitquantreg