File: meanshift.Rd

package info (click to toggle)
r-cran-modeest 2.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 280 kB
  • sloc: makefile: 2
file content (67 lines) | stat: -rw-r--r-- 1,826 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/meanshift.R
\name{meanshift}
\alias{meanshift}
\title{The Meanshift mode estimator}
\usage{
meanshift(
  x,
  bw = NULL,
  kernel = "gaussian",
  par = shorth(x),
  iter = 1000,
  tolerance = sqrt(.Machine$double.eps)
)
}
\arguments{
\item{x}{numeric. Vector of observations.}

\item{bw}{numeric. The smoothing bandwidth to be used.}

\item{kernel}{character. The kernel to be used. Available kernels are 
\code{"biweight"}, \code{"cosine"}, \code{"eddy"}, 
\code{"epanechnikov"}, \code{"gaussian"}, \code{"optcosine"}, 
\code{"rectangular"}, \code{"triangular"}, \code{"uniform"}. 
See \code{\link[stats]{density}} for more details on some of these kernels.}

\item{par}{numeric. The initial value used in the meanshift algorithm.}

\item{iter}{numeric. Maximal number of iterations.}

\item{tolerance}{numeric. Stopping criteria.}
}
\value{
\code{meanshift} returns a numeric value, the mode estimate, 
with an attribute \code{"iterations"}. 
The number of iterations can be less than \code{iter} 
if the stopping criteria specified by \code{eps} is reached.
}
\description{
The Meanshift mode estimator.
}
\note{
The user should preferentially call \code{meanshift} through 
\code{mlv(x, method = "meanshift", ...)}.
}
\examples{
# Unimodal distribution
x <- rweibull(100, shape = 12, scale = 0.8)

## True mode
weibullMode(shape = 12, scale = 0.8)

## Estimate of the mode
mlv(x, method = "meanshift", par = mean(x))

}
\references{
\itemize{ 
  \item Fukunaga, K. and Hostetler, L. (1975).  
  The estimation of the gradient of a density function, 
  with applications in pattern recognition. 
  \emph{IEEE Transactions on Information Theory}, \bold{21}(1):32--40. 
}
}
\seealso{
\code{\link[modeest]{mlv}}, \code{\link[modeest]{tsybakov}}.
}