predict.blite {lite} | R Documentation |
Predictive inference for the largest value observed in N
years.
Description
predict
method for class "blite". Performs predictive inference
about the largest value to be observed over a future time period of
N
years. Predictive inferences accounts for uncertainty in model
parameters and for uncertainty owing to the variability of future
observations.
Usage
## S3 method for class 'blite'
predict(
object,
type = c("i", "p", "d", "q", "r"),
x = NULL,
x_num = 100,
n_years = 100,
ny = NULL,
level = 95,
hpd = FALSE,
lower_tail = TRUE,
log = FALSE,
big_q = 1000,
...
)
Arguments
object |
An object of class |
type |
A character vector. Indicates which type of inference is required:
|
x |
A numeric vector or a matrix with
|
x_num |
A numeric scalar. If |
n_years |
A numeric vector. Values of |
ny |
A numeric scalar. The (mean) number of observations per year. Setting this appropriately is important. See Details. |
level |
A numeric vector of values in (0, 100).
Only relevant when |
hpd |
A logical scalar.
Only relevant when If If |
lower_tail |
A logical scalar.
Only relevant when |
log |
A logical scalar. Only relevant when |
big_q |
A numeric scalar. Only relevant when |
... |
Additional optional arguments. At present no optional arguments are used. |
Details
The function predict.evpost
in the
revdbayes
package is used to perform the
predictive inferences. The effect of adjusting for the values of the
extremal index \theta
in the posterior sample in
object$sim_vals[, "theta"]
is to change the effective time horizon
from N
to \theta N
.
ny
provides information about the (intended) frequency of
sampling in time, that is, the number of observations that would be
observed in a year if there are no missing values. If the number of
observations may vary between years then ny
should be set equal to
the mean number of observations per year.
Supplying ny
.
The value of ny
may have been set in the call to
blite
. If ny
is supplied by the user in the call to
predict.blite
then this will be used in preference to the value
stored in the fitted model object. If these two values differ then no
warning will be given.
Value
An object of class "evpred", a list containing a subset of the following components:
type |
The argument |
x |
A matrix containing the argument |
y |
The content of
|
long |
A |
short |
A matrix with the same structure as |
The arguments n_years, level, hpd, lower_tail, log
supplied
to predict.blite
are also included, as is the value of ny
and model = "bingp"
.
Examples
### Cheeseboro wind gusts
cdata <- exdex::cheeseboro
# Each column of the matrix cdata corresponds to data from a different year
# blite() sets cluster automatically to correspond to column (year)
cpost <- blite(cdata, u = 45, k = 3, ny = 31 * 24)
# Interval estimation
predict(cpost)$long
predict(cpost, hpd = TRUE)$short
# Density function
plot(predict(cpost, type = "d", n_years = c(100, 1000)))
# Distribution function
plot(predict(cpost, type = "p", n_years = c(100, 1000)))
# Quantiles
predict(cpost, type = "q", n_years = c(100, 1000))$y
# Random generation
plot(predict(cpost, type = "r"))