quantile.expert: Quantiles of the Expert Aggregated Distribution

Description Usage Arguments Details Value See Also Examples

View source: R/quantile.expert.R

Description

Quantile for objects of class "expert".

Usage

1
2
3
## S3 method for class 'expert'
quantile(x, probs = seq(0, 1, 0.25),
         smooth = FALSE, names = TRUE, ...)

Arguments

x

an object of class "expert".

probs

numeric vector of probabilities with values in [0, 1).

smooth

logical; when TRUE and x is a step function, quantiles are linearly interpolated between knots.

names

logical; if true, the result has a names attribute. Set to FALSE for speedup with many probs.

...

further arguments passed to or from other methods.

Details

The quantiles are taken directly from the cumulative distribution function defined in x. Linear interpolation is available for step functions.

Value

A numeric vector, named if names is TRUE.

See Also

expert

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
x <- list(E1 <- list(A1 <- c(0.14, 0.22, 0.28),
                     A2 <- c(130000, 150000, 200000),
                     X <- c(350000, 400000, 525000)),
          E2 <- list(A1 <- c(0.2, 0.3, 0.4),
                     A2 <- c(165000, 205000, 250000),
                     X <- c(550000, 600000, 650000)),
          E3 <- list(A1 <- c(0.2, 0.4, 0.52),
                     A2 <- c(200000, 400000, 500000),
                     X <- c(625000, 700000, 800000)))
probs <- c(0.1, 0.5, 0.9)
true.seed <- c(0.27, 210000)
fit <- expert(x, "cooke", probs, true.seed, 0.03)
quantile(fit)                             # default probs
quantile(fit, probs = c(0.9, 0.95, 0.99)) # right tail

Example output

      0%      25%      50%      75%     100% 
305000.0 512930.5 563423.2 563423.2 845000.0 
   90%    95%    99% 
628864 628864 628864 

expert documentation built on May 2, 2019, 2:27 p.m.