Learn R Programming

ROptEstOld (version 1.2.0)

ksEstimator: Generic Function for the Computation of the Kolmogorov Minimum Distance Estimator

Description

Generic function for the computation of the Kolmogorov(-Smirnov) minimum distance estimator.

Usage

ksEstimator(x, distribution, ...)

# S4 method for numeric,Binom ksEstimator(x, distribution, param, eps = .Machine$double.eps^0.5)

# S4 method for numeric,Pois ksEstimator(x, distribution, param, eps = .Machine$double.eps^0.5)

# S4 method for numeric,Norm ksEstimator(x, distribution, param, eps = .Machine$double.eps^0.5)

# S4 method for numeric,Lnorm ksEstimator(x, distribution, param, eps = .Machine$double.eps^0.5)

# S4 method for numeric,Gumbel ksEstimator(x, distribution, param, eps = .Machine$double.eps^0.5)

# S4 method for numeric,Exp ksEstimator(x, distribution, param, eps = .Machine$double.eps^0.5)

# S4 method for numeric,Gammad ksEstimator(x, distribution, param, eps = .Machine$double.eps^0.5)

Arguments

x

sample

distribution

object of class "Distribution"

additional parameters

param

name of the unknown parameter. If missing all parameters of the corresponding distribution are estimated.

eps

the desired accuracy (convergence tolerance).

Value

The Kolmogorov minimum distance estimator is computed. Returns a list with components named like the parameters of distribution.

Methods

x = "numeric", distribution = "Binom"

Binomial distributions.

x = "numeric", distribution = "Pois"

Poisson distributions.

x = "numeric", distribution = "Norm"

Normal distributions.

x = "numeric", distribution = "Lnorm"

Lognormal distributions.

x = "numeric", distribution = "Gumbel"

Gumbel distributions.

x = "numeric", distribution = "Exp"

Exponential distributions.

x = "numeric", distribution = "Gamma"

Gamma distributions.

Details

In case of discrete distributions the Kolmogorov distance is computed and the parameters which lead to the minimum distance are returned. In case of absolutely continuous distributions ks.test is called and the parameters which minimize the corresponding test statistic are returned.

References

Rieder, H. (1994) Robust Asymptotic Statistics. New York: Springer.

Kohl, M. (2005) Numerical Contributions to the Asymptotic Theory of Robustness. Bayreuth: Dissertation.

See Also

Distribution-class

Examples

Run this code
# NOT RUN {
x <- rnorm(100, mean = 1, sd = 2)
ksEstimator(x=x, distribution = Norm()) # estimate mean and sd
ksEstimator(x=x, distribution = Norm(mean = 1), param = "sd") # estimate sd
ksEstimator(x=x, distribution = Norm(sd = 2), param = "mean") # estimate mean
mean(x)
median(x)
sd(x)
mad(x)
# }

Run the code above in your browser using DataLab