View source: R/quantile_pred-methods.R
quantile.quantile_pred | R Documentation |
Given a hardhat::quantile_pred object, users may wish to compute additional
quantile_levels
that are not part of the object. This function attempts
to estimate these quantities under some assumptions. Interior probabilities,
those contained within existing probabilities are interpolated in a manner
controled by the middle
argument. Those outside existing probabilities
are extrapolated under the assumption that the tails of the distribution
decays exponentially. Optionally, one may constrain all quantiles to be
within some support (say, [0, Inf)
).
## S3 method for class 'quantile_pred'
quantile(
x,
probs = seq(0, 1, 0.25),
na.rm = FALSE,
lower = -Inf,
upper = Inf,
middle = c("cubic", "linear"),
...
)
x |
numeric vector whose sample quantiles are wanted, or an
object of a class for which a method has been defined (see also
‘details’). |
probs |
numeric vector of probabilities with values in
|
na.rm |
logical; if true, any |
lower |
Scalar. Optional lower bound. |
upper |
Scalar. Optional upper bound. |
middle |
Controls how extrapolation to "interior" probabilities is
performed. "cubic" attempts to use |
... |
unused |
a matrix with one row for each entry in x
and one column for each
value in probs
extrapolate_quantiles()
qp <- quantile_pred(matrix(1:8, nrow = 2, byrow = TRUE), 1:4 / 5)
quantile(qp)
quantile(qp, lower = 0)
quantile(qp, probs = 0.5)
quantile(qp, probs = 1:9 / 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.