cdf: Expert Aggregated Cumulative Distribution Function

Description Usage Arguments Details Value See Also Examples

View source: R/cdf.R

Description

Compute or plot the cumulative distribution function for objects of class "expert".

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
cdf(x, ...)

## S3 method for class 'cdf'
print(x, digits = getOption("digits") - 2, ...)

## S3 method for class 'cdf'
knots(Fn, ...)

## S3 method for class 'cdf'
plot(x, ..., ylab = "F(x)", verticals = FALSE,
     col.01line = "gray70")

Arguments

x

an object of class "expert"; for the methods, an object of class "cdf", typically.

digits

number of significant digits to use, see print.

Fn

an R object inheriting from "cdf".

...

arguments to be passed to subsequent methods, e.g. plot.stepfun for the plot method.

ylab

label for the y axis.

verticals

see plot.stepfun.

col.01line

numeric or character specifying the color of the horizontal lines at y = 0 and 1, see colors.

Details

The function builds the expert aggregated cumulative distribution function corresponding to the results of expert.

The function plot.cdf which implements the plot method for cdf objects, is implemented via a call to plot.stepfun; see its documentation.

Value

For cdf, a function of class "cdf", inheriting from the "function" class.

See Also

expert to create objects of class "expert"; ogive for the linear interpolation; ecdf and stepfun for related documentation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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)
Fn <- cdf(fit)
Fn
knots(Fn)            # the group boundaries

Fn(knots(Fn))        # true values of the cdf

plot(Fn)             # graphic

Example output

Aggregate Expert CDF
Call: cdf(fit)
    x = 3.05e+05, 5.1293e+05, 5.6342e+05, 6.2886e+05, 8.45e+05
 F(x) =      0,    0.1,    0.5,    0.9,      1
[1] 305000.0 512930.5 563423.2 628864.0 845000.0
[1] 0.0 0.1 0.5 0.9 1.0

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

Related to cdf in expert...