Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision d313e454f0f03d26eb1ecbd8885ebda4bc87f231 authored by Kevin R. Coombes on 13 July 2017, 14:35:59 UTC, committed by cran-robot on 13 July 2017, 14:35:59 UTC
version 2.1.3
0 parent
  • Files
  • Changes
  • 5a5353d
  • /
  • man
  • /
  • maha.Rd
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:d313e454f0f03d26eb1ecbd8885ebda4bc87f231
directory badge Iframe embedding
swh:1:dir:58b83137a1f79af2f5eb4b93873551e6d65f07bd
content badge Iframe embedding
swh:1:cnt:db3155f4505dd1b71aa201313b8e28fb051feb4f

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
maha.Rd
\name{maha}
\Rdversion{1.1}
\alias{maha}
\title{
Compute the (squared) Mahalanobis distance between two groups of vectors
}
\description{
The Mahalanobis distance between two groups of vectors 
}
\usage{
maha(data, groups, method = "mve")
}

\arguments{
  \item{data}{A matrix with columns representing features (or variables)
    and rows representing independent samples}
  \item{groups}{
    A factor or logical vector with length equal to the number of rows
    (samples) in the \code{data} matrix}
  \item{method}{
    A character string determining the method that should be used to
    estimate the covariance matrix. The default value of "\code{mve}"
    uses the \link[MASS]{cov.mve} function from the MASS package. The
    other valid option is "var", which uses the \code{\link{var}}
    function from the standard \code{stats} package.}
}
\details{
  The Mahalanobis distance between two groups of vectors is the distance
  between their centers, computed in the equivalent of a principal
  component space that accounts for different variances.
}
\value{
  Returns a numeric vector of length 1.
}
\references{
  Mardia, K. V. and Kent, J. T. and Bibby, J. M.\cr
  \emph{Multivariate Analysis}.\cr
  Academic Press, Reading, MA {1979}, pp. 213--254.
}
\author{
  Kevin R. Coombes \email{krc@silicovore.com},
  P. Roebuck \email{proebuck@mdanderson.org}
}
\seealso{
  \code{\link[MASS]{cov.mve}},
  \code{\link[stats]{var}}
}
\examples{
nFeatures <- 40
nSamples <- 2*10
dataset <- matrix(rnorm(nSamples*nFeatures), ncol=nSamples)
groups <- factor(rep(c("A", "B"), each=10))
maha(dataset, groups)
}
\keyword{multivariate}

The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API