| mde.wrappednormal {wle} | R Documentation |
Computes the minimum distance estimates for the parameters of a Wrapped Normal distribution: the mean direction and the concentration parameter (and the scale parameter).
mde.wrappednormal(x, bw, mu = NULL, rho = NULL, sd = NULL, alpha = NULL, p = 2, tol = 1e-05, n = 512, from = circular(0), to = circular(2 * pi), lower = NULL, upper = NULL, method = "L-BFGS-B", lower.rho = 1e-06, upper.rho = 1 - 1e-06, min.sd = 0.001, K = NULL, min.k = 10, control.circular = list(), ...)
## S3 method for class 'mde.wrappednormal':
print(x, digits = max(3, getOption("digits") - 3), ...)
x |
a vector. The object is coerced to class circular. |
bw |
the value of the smoothing parameter. |
mu |
initial value for the mean direction. Default: maximum likelihood estimate. |
rho |
initial value for the concentration parameter. Default: maximum likelihood estimate. |
sd |
initial value for the standard deviation parameter. This value is used only if rho is NULL. Default: maximum likelihood estimate. |
alpha |
see the next argument p. This is a different
parameterization, alpha=-1/2 provides Hellinger distance,
alpha=-1 provides Kullback-Leibler distance and alpha=-2
provides Neyman's Chi-Square distance. |
p |
p=2 provides Hellinger distance, p=-1
provides Kullback-Leibler distance and p=Inf provides Neyman's
Chi-Square distance. It is ignored if alpha is not NULL. |
tol |
the absolute accuracy to be used to achieve convergence of the algorithm. This argument is passed to the function which determined the Maximum Likelihood estimates of the parameters. See mle.wrappednormal. |
n |
number of points used to approximate the density. |
from |
from which point in the circle the density is approximate. |
to |
to which point in the circle the density is approximate. |
lower |
a 2 elements vector passed to optim used to constrained optimization. First element for the mean direction, second element for the concentration. |
upper |
a 2 elements vector passed to optim used to constrained optimization. First element for the mean direction, second element for the concentration. |
method |
passed to optim. |
lower.rho |
if lower is NULL this parameter is used to constrained optimization for the concentration parameter. |
upper.rho |
if upper is NULL this parameter is used to constrained optimization for the concentration parameter. |
min.sd |
minimum value for the sd parameter. This argument is passed to the function which determined the Maximum Likelihood estimates of the parameters. See mle.wrappednormal. |
K |
number of elements used to approximate the density of the wrapped normal. |
min.k |
minimum number of elements used to approximate the density of the wrapped normal. |
control.circular |
the attribute of the resulting object (mu) |
digits |
integer indicating the precision to be used. |
... |
further parameters in print.mde.wrappednormal. |
The distance from an estimated density (by the non parametric kernel density estimator) and the model is evaluated by simple rectangular approximation. optim is used to performs minimization.
Returns a list with the following components:
call |
the match.call(). |
mu |
the estimate of the mean direction. |
rho |
the estimate of the concentration parameter. |
sd |
the estimate of the standard deviation parameter. |
dist |
the distance between the estimated density and the model. |
data |
the original supplied data converted in radians, clockwise and zero at 0. |
x |
the 'n' coordinates of the points where the density is estimated. |
y |
the estimated density values. |
k |
the density at the model. |
Claudio Agostinelli
C. Agostinelli (2006) Robust Estimation for Circular Data, under revision.
circular, mle.wrappednormal and wle.wrappednormal.
if (require(circular)) {
set.seed(1234)
x <- c(rwrappednormal(n=200, mu=circular(0), sd=0.6), rwrappednormal(n=20, mu=circular(pi/2), sd=0.1))
res <- mde.wrappednormal(x, bw=0.08, mu=circular(0), sd=0.6)
res
plot(circular(0), type='n', xlim=c(-1, 1.75), shrink=1.2)
lines(circular(res$x), res$y)
lines(circular(res$x), res$k, col=2)
legend(1,1.5, legend=c('estimated density', 'MDE'), lty=c(1, 1), col=c(1, 2))
} else {
cat("Please, install the package 'circular' in order to use this function.\n")
}