% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/diss_methods.R
\name{diss_cosine}
\alias{diss_cosine}
\title{Cosine dissimilarity method constructor}
\usage{
diss_cosine(center = TRUE, scale = FALSE)
}
\arguments{
\item{center}{Logical. Center the data before computing dissimilarities?
Applied jointly to \code{Xr} and \code{Xu} if both are provided.
Default \code{TRUE}.}

\item{scale}{Logical. Scale the data before computing dissimilarities?
Applied jointly to \code{Xr} and \code{Xu} if both are provided.
Default \code{FALSE}.}
}
\value{
An object of class \code{c("diss_cosine", "diss_method")}.
}
\description{
Creates a configuration object for computing cosine dissimilarity
(also known as spectral angle mapper). Pass the result to
\code{dissimilarity()} to compute the dissimilarity matrix.

The cosine dissimilarity between two observations \eqn{x_i} and
\eqn{x_j} is:

\deqn{c(x_i, x_j) = \cos^{-1}
  \frac{\sum_{k=1}^{p} x_{i,k}\, x_{j,k}}
       {\sqrt{\sum_{k=1}^{p} x_{i,k}^{2}}\,
        \sqrt{\sum_{k=1}^{p} x_{j,k}^{2}}}}

where \eqn{p} is the number of variables.
}
\examples{
m <- diss_cosine()
m <- diss_cosine(center = FALSE)
}
\seealso{
\code{\link{dissimilarity}}, \code{\link{diss_euclidean}},
\code{\link{diss_mahalanobis}}
}
\author{
\href{https://orcid.org/0000-0002-5369-5120}{Leonardo Ramirez-Lopez}
}
