Methods for objects of class "return_level"
Source: R/methods_return_level.R
return_level_methods.RdMethods for objects of class "return_level" returned from gev_return.
Usage
# S3 method for class 'return_level'
coef(object, ...)
# S3 method for class 'return_level'
print(x, ...)
# S3 method for class 'return_level'
vcov(object, ...)
# S3 method for class 'return_level'
summary(object, digits = max(3, getOption("digits") - 3L), ...)
# S3 method for class 'summary.return_level'
print(x, ...)
# S3 method for class 'return_level'
confint(
object,
parm = 1:length(object),
level = 0.95,
profile = FALSE,
mult = 2,
faster = FALSE,
epsilon = 1e-04,
...
)Arguments
- object, x
An object inheriting from class
"return_level", a result of a call togev_return.objectis a named numeric vector of MLEs of return levels.For
print.summary.return_level, this is an object returned by the functionsummary.return_level.- ...
Further arguments. Only used for
print.summary.return_levelto pass arguments toprint.- digits
An integer. Passed to
signifto round the values in the summary.- parm
A numeric vector. For which components, that is, which return levels, in
objectwe require a confidence interval.- level
The confidence level required. A numeric scalar in (0, 1).
- profile
A logical scalar. If
TRUEthen confidence intervals based on a profile log-likelihood are returned. IfFALSEthen intervals based on approximate large sample normal theory, which are symmetric about the MLE, are returned.- mult
A positive numeric scalar. Controls the increment by which the parameter of interest is increased/decreased when profiling above/below its MLE. The increment is
mult * se / 100whereseis the estimated standard error of the estimator of the return level. Decreasingmultprofiles at more points but will be slower.- faster
A logical scalar. If
faster = TRUEthen the profiling of the log-likelihood in search of a lower (upper) confidence limit is started at the corresponding symmetric lower (upper) confidence limit.- epsilon
Only relevant if
profile = TRUE. A numeric vector of values that determine the accuracy of the confidence limits.epsilonis recycled to the length of the parameter vectorparm.If
epsilon[i] > 0then this value is passed as the argumentepsilonto theitp::itpfunction, which estimates the parameter values for which the profile log-likelihood for parameteridrops to the value that defines the confidence limits, once profiling has been successful in finding an interval within which this value lies.If
epsilon[i] < 0quadratic interpolation is used, which will tend to be faster.If
epsilon[i] = 0then linear interpolation is used, which will be faster still.
Value
print.return_level and coef.return_level: a numeric vector
containing the MLEs of return return levels.
vcov.return_level: a length(object) by length(object) matrix with
row and column names indicating the return periods of the return levels.
The estimated variance-covariance matrix for the return levels in
object. The diagonal elements give the estimated variances associated
with the individual return level estimates.
summary.return_level: an object containing the original function call
and a matrix of estimates of return levels and associated estimated
standard errors with row names indicating the respective return periods.
The object is printed by print.summary.return_level.
print.summary.return_level: the argument x is returned, invisibly.
confint.return_level: an object of class
c("confint_return_level", "evmissing"). A numeric matrix with 2 columns
giving the lower and upper confidence limits for each return level. These
columns are labelled as (1-level)/2 and 1-(1-level)/2, expressed as a
percentage, by default 2.5% and 97.5%. The row names indicate the
return levels.
If profile = TRUE then the returned object has extra attributes crit,
level and for_plot. The latter is a named list of length parm with
components named after the return periods. Each components is a 2-column
numeric matrix. The first column contains values of the return level and
the second column the corresponding values of the profile log-likelihood.
The profile log-likelihood is equal to the attribute crit at the limits
of the confidence interval. The attribute level is the input argument
level.
Details
For confint.return_level, the default, epsilon = -1, should
work well enough in most circumstances, but to achieve a specific accuracy
set epsilon to be a small positive value, for example, epsilon = 1e-4.
See also
gev_mle and gev_return, for examples of the use of
confint.return_level.
Examples
## Plymouth ozone data
# See ?gev_return for confidence intervals for return levels
fit <- gev_mle(PlymouthOzoneMaxima)
rl <- gev_return(fit, m = c(100, 200))
rl
#> 100-year level 200-year level
#> 215.5104 228.6658
vcov(rl)
#> 100-year level 200-year level
#> 100-year level 1123.37 1464.100
#> 200-year level 1464.10 1916.351
summary(rl)
#>
#> Call:
#> gev_return(x = fit, m = c(100, 200))
#>
#> Estimate Std. Error
#> 100-year level 215.5 33.52
#> 200-year level 228.7 43.78