cvm: Calculate Cramer von Mises Minimum Distance Estimates

View source: R/cvm.R

cvmR Documentation

Calculate Cramer von Mises Minimum Distance Estimates

Description

The function cvm calculates Cramer von Mises Minimum Distance Estimates. It is used to compute valid starting estimates for simple parametric models inside of function rmx. The functions are rarely called directly and are mainly for internal use.

Usage

cvm(x, model = "norm", mu = "model", na.rm = TRUE, ...)

cvm.norm(x, mu, startPar = NULL)

cvm.binom(x, mu, size)

cvm.pois(x, mu)

cvm.exp(x, mu)

rowCVM(x, model, mu = "model", na.rm = TRUE, parallel = FALSE, ncores = NULL, ...)

Arguments

x

numeric vector of data.

model

character: short name of the model/distribution (default = "norm"); see also details.

mu

possible options are "model" and "data"; see also details.

na.rm

logical: if TRUE, NA values are removed before the estimator is evaluated.

startPar

parameter values used as starting point for the optimization. If missing or NULL, appropriate default values are computed.

size

size parameter of binomial distribution (known!); see dbinom.

parallel

logical: use package parallel for computations.

ncores

if parallel = TRUE: number of cores used for computations. If missing, the maximum number of cores - 1 is used.

...

further arguments passed through; e.g., known parameters as for instance size in case of the binomial model.

Details

The function is inspired by function CvMMDEstimator of package distrMod. We also recommend to use package distrMod for statistical inference based on the Cramer von Mises estimator. In our package the function is used as a helper function to provide valid starting estimates for our RMX estimators. For more details about minimum distance estimation we refer to Section 6.3.2 of Rieder (1994).

By setting mu = "model" the model distribution is used as weighting measure in the Cramer von Mises distance. Using mu = "data" leads to weighting by the empiricial distribution of the provided data.

As models we have implemented so far:

  1. "norm": normal location (mean) and scale (sd).

  2. "binom": probability of success (prob).

  3. "pois": mean (lambda).

  4. "exp": scale (1/rate).

Value

Cramer von Mises minimum distance estimator.

Author(s)

Matthias Kohl Matthias.Kohl@stamats.de

References

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

M. Kohl, P. Ruckdeschel, and H. Rieder (2010). Infinitesimally Robust Estimation in General Smoothly Parametrized Models. Statistical Methods and Application, 19(3):333-354.

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

See Also

rmx, mse

Examples

x <- rnorm(100)
cvm(x, model = "norm")
cvm(x, model = "norm", mu = "data")

x <- rbinom(100, prob = 0.2, size = 3)
cvm(x, model = "binom", size = 3)
cvm(x, model = "binom", size = 3, mu = "data")

x <- rpois(100, lambda = 1.5)
cvm(x, model = "pois")
cvm(x, model = "pois", mu = "data")

x <- rexp(100, rate = 3)
cvm(x, model = "exp")
cvm(x, model = "exp", mu = "data")

###############################################################################
## row-wise computations for data matrices
###############################################################################
X <- matrix(rnorm(200), ncol = 10)
rowCVM(X, model = "norm")

X <- matrix(rbinom(200, prob = 0.2, size = 3), ncol = 10)
rowCVM(X, model = "binom", size = 3)

X <- matrix(rpois(200, lambda = 1.5), ncol = 10)
rowCVM(X, model = "pois")

X <- matrix(rexp(200, rate = 3), ncol = 10)
rowCVM(X, model = "exp")

stamats/rmx documentation built on Sept. 29, 2023, 7:13 p.m.