Learn R Programming

reliaR (version 0.01)

ks.gompertz: Test of Kolmogorov-Smirnov for the Gompertz distribution

Description

The function ks.gompertz() gives the values for the KS test assuming a Gompertz with shape parameter alpha and scale parameter theta. In addition, optionally, this function allows one to show a comparative graph between the empirical and theoretical cdfs for a specified data set.

Usage

ks.gompertz(x, alpha.est, theta.est, alternative = c("less", "two.sided", "greater"), plot = FALSE, ...)

Arguments

x
vector of observations.
alpha.est
estimate of the parameter alpha
theta.est
estimate of the parameter theta
alternative
indicates the alternative hypothesis and must be one of "two.sided" (default), "less", or "greater".
plot
Logical; if TRUE, the cdf plot is provided.
...
additional arguments to be passed to the underlying plot function.

Value

ks.gompertz() carries out the KS test for the Gompertz

Details

The Kolmogorov-Smirnov test is a goodness-of-fit technique based on the maximum distance between the empirical and theoretical cdfs.

References

Marshall, A. W., Olkin, I. (2007). Life Distributions: Structure of Nonparametric, Semiparametric, and Parametric Families, Springer, New York.

See Also

pp.gompertz for PP plot and qq.gompertz for QQ plot

Examples

Run this code
## Load data sets
data(sys2)
## Maximum Likelihood(ML) Estimates of alpha & theta for the data(sys2)
## Estimates of alpha & theta using 'maxLik' package
## alpha.est = 0.00121307, theta.est = 0.00173329

ks.gompertz(sys2, 0.00121307, 0.00173329, alternative = "two.sided", plot = TRUE)

Run the code above in your browser using DataLab