\Header{qerror}{quantization accuracy}
\keyword{arith}{qerror}
\begin{Description}\relax
get the average distortion measure\end{Description}
\begin{Usage}
\begin{verbatim}
qerror(obj, err.radius=1)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{obj}] a `som' object 
\item[\code{err.radius}] radius used calculating qerror 
\end{ldescription}
\end{Arguments}
\begin{Value}
An average of the following quantity (weighted distance measure) over all x in the sample,
\deqn{\sum ||x - m_i|| h_{ci}}{sum |x - m\_i| h\_{ci}}
where \eqn{h_{ci}}{h\_{ci}} is the neighbourhood kernel for the ith code.\end{Value}
\begin{Author}\relax
Jun Yan <jyan@stat.wisc.edu>\end{Author}
\begin{Examples}
\begin{ExampleCode}
foo <- som(matrix(rnorm(1000), 100), 2, 4)
qerror(foo, 3)
\end{ExampleCode}
\end{Examples}

