| ogive {expert} | R Documentation |
Compute a smoothed empirical distribution function for objects of
class "expert".
ogive(x, ...)
## S3 method for class 'ogive':
print(x, digits = getOption("digits") - 2, ...)
## S3 method for class 'ogive':
knots(Fn, ...)
## S3 method for class 'ogive':
plot(x, main = NULL, xlab = "x", ylab = "G(x)", ...)
x |
an object of class "expert"; for the methods, an
object of class "ogive", typically. |
digits |
number of significant digits to use, see
print. |
Fn |
an R object inheriting from "ogive". |
main |
main title. |
xlab, ylab |
labels of x and y axis. |
... |
arguments to be passed to subsequent methods. |
The ogive is a linear interpolation of the empirical cumulative distribution function.
The equation of the ogive is
G(x) = ((c[j] - x) F(c[j-1]) + (x - c[j-1]) F(c[j]))/(c[j] - c[j-1])
for c[j-1] < x <= c[j] and where c[0], ..., c[r] are the r + 1 group boundaries and F is the cumulative distribution function.
For ogive, a function of class "ogive", inheriting from the
"function" class.
Klugman, S. A., Panjer, H. H. and Willmot, G. E. (1998), Loss Models, From Data to Decisions, Wiley.
expert to create objects of class "expert";
cdf for the true cumulative distribution function;
approxfun, which is used to compute the ogive;
stepfun for related documentation (even though the ogive
is not a step function).
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 <- ogive(fit)
Fn
knots(Fn) # the group boundaries
Fn(knots(Fn)) # true values of the empirical cdf
Fn(c(80, 200, 2000)) # linear interpolations
plot(Fn)