\HeaderA{distances}{Different distances between two given vectors}{distances}
\aliasA{cosin.dist}{distances}{cosin.dist}
\aliasA{euclidian.dist}{distances}{euclidian.dist}
\aliasA{L1.dist}{distances}{L1.dist}
\aliasA{rank.cor.dist}{distances}{rank.cor.dist}
\keyword{misc}{distances}
\begin{Description}\relax
These functions are used for calculating different distances between
two given vectors. Thus, \code{L1.dist} calculates the L1 distance,
\code{cosin.dist} calculates the cosine distance, \code{euclidian.dist}
computes the Euclidian distance, and \code{rank.cor.dist} computes
the rank correlation distance. The vectors have to have same length.
When using \code{rank.cor.dist} the vectors have to have length larger
than 4.
\end{Description}
\begin{Usage}
\begin{verbatim}
L1.dist(p, q)
cosin.dist(p, q)
euclidian.dist(x, y)
rank.cor.dist(x, y)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{p}] A \code{numeric} vector specifying the first component for
the distance calculation. It has to have the same length as \code{q}.
\item[\code{q}] A \code{numeric} vector specifying the second component for
the distance calculation. 
\item[\code{x}] Same as \code{p}. 
\item[\code{y}] Same as \code{q}.
\end{ldescription}
\end{Arguments}
\begin{Value}
The functions return the distance between the two given vectors.
\end{Value}
\begin{Author}\relax
Jasmina Bogojeska
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{kullback.leibler}{kullback.leibler}}, \code{\LinkA{L2.norm}{L2.norm}}, \code{\LinkA{stability.sim}{stability.sim}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## Define two numeric vectors with equal lengths (> 4).
x <- c(1, 2, 3, 4, 5)
y <- c(5, 6, 7, 8, 9)

## Calculate the L1 distance between the vectors x and y
L1.dist(x, y)

## Calculate the Euclidian distance between the vectors x and y
euclidian.dist(x, y)

## Calculate the cosine distance between the vectors x and y
cosin.dist(x, y)

## Calculate the rank-correlation distance between the vectors x and y
rank.cor.dist(x, y)

\end{ExampleCode}
\end{Examples}

