cvm | R Documentation |
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.
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, ...)
x |
numeric vector of data. |
model |
character: short name of the model/distribution
(default = |
mu |
possible options are |
na.rm |
logical: if |
startPar |
parameter values used as starting point for the optimization.
If missing or |
size |
size parameter of binomial distribution (known!); see |
parallel |
logical: use package parallel for computations. |
ncores |
if |
... |
further arguments passed through; e.g., known parameters as
for instance |
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:
"norm"
: normal location (mean
) and scale (sd
).
"binom"
: probability of success (prob
).
"pois"
: mean (lambda
).
"exp"
: scale (1/rate
).
Cramer von Mises minimum distance estimator.
Matthias Kohl Matthias.Kohl@stamats.de
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.
rmx
, mse
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.