Revision b075661d51a7a1ee9b00d94017b8a6be03730ba4 authored by Matthias Templ on 29 April 2009, 00:00:00 UTC, committed by Gabor Csardi on 29 April 2009, 00:00:00 UTC
1 parent 2e8aee4
Raw File
aDist.Rd
\name{aDist}
\alias{aDist}
\title{Aitchison distance}
\description{
  Computes the Aitchison distance between two observations or between two data sets.
}
\usage{
aDist(x, y)
}
\arguments{
  \item{x}{ a vector, matrix or data.frame }
  \item{y}{ a vector, matrix or data.frame with equal dimension as \code{x} }
}
\details{
  This distance measure accounts for the relative scale property of the 
  Aitchison distance. It measures the distance between two compositions if \code{x} and \code{y} 
  are vectors and evaluate sum of the distances between \code{x} and \code{y} for each row of \code{x} and \code{y} if
  \code{x} and \code{y} are matrizes or data frames.
  
  It is not designed to apply it on one matrix, 
  such as function \sQuote{acomp()} in package \sQuote{compositions}, 
  but it is designed to compare different matrices.
  
  The underlying code is written in C and allows a fast computation also for large data sets.
}
\value{
  The Aitchison distance between two compositions or between two data sets.
}
\references{ Aitchison, J. (1986) \emph{The Statistical Analysis of Compositional
Data} Monographs on Statistics and Applied Probability. Chapman \&
Hall Ltd., London (UK). 416p. }
\author{ Matthias Templ }
\seealso{ \code{\link{ilr}} }
\examples{
data(aitchison395)
x <- xOrig <- aitchison395
## Aitchison distance between the first 2 observations:
aDist(x[,1], x[,2])

## set some missing values:
x[1,3] <- x[3,5] <- x[2,4] <- x[5,3] <- x[8,3] <- NA

## impute them:
xImp <- impCoda(x, method="ltsReg")$xImp

## calculate the relative Aitchsion distance between xOrig and xImp:
aDist(xOrig, xImp)
}
\keyword{ math }
\keyword{ arith }
back to top