Revision 9ae1e67cb5e13c5bbc731a5fc56a0053182f16b0 authored by Matthias Templ on 11 February 2020, 16:20:02 UTC, committed by cran-robot on 11 February 2020, 16:20:02 UTC
1 parent 775c7e1
Raw File
pivotCoord.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/isomLR.R
\name{pivotCoord}
\alias{pivotCoord}
\alias{isomLR}
\alias{isomLRinv}
\alias{isomLRp}
\alias{isomLRinvp}
\alias{pivotCoordInv}
\title{Pivot coordinates and their inverse}
\usage{
pivotCoord(
  x,
  pivotvar = 1,
  fast = FALSE,
  method = "pivot",
  base = exp(1),
  norm = "orthonormal"
)

isomLR(x, fast = FALSE, base = exp(1), norm = "sqrt((D-i)/(D-i+1))")

isomLRinv(x)

pivotCoordInv(x, norm = "orthonormal")

isomLRp(x, fast = FALSE, base = exp(1), norm = "sqrt((D-i)/(D-i+1))")

isomLRinvp(x)
}
\arguments{
\item{x}{object of class data.frame or matrix. Positive values only.}

\item{pivotvar}{pivotal variable. If any other number than 1, the data are resorted in 
that sense that the pivotvar is shifted to the first part.}

\item{fast}{if TRUE, it is approx. 10 times faster but numerical problems in case of 
high-dimensional data may occur. Only available for method \dQuote{pivot}.}

\item{method}{pivot takes the method described in the description. Method "symm" 
uses symmetric pivot coordinates (parameters pivotvar and norm have then no effect)}

\item{base}{a positive or complex number: 
the base with respect to which logarithms are computed. Defaults to \code{exp(1)}.}

\item{norm}{if FALSE then the normalizing constant is not used, if TRUE \code{sqrt((D-i)/(D-i+1))} is 
used (default). The user can also specify a self-defined constant.}
}
\value{
The data represented in pivot coordinates
}
\description{
Pivot coordinates as a special case of isometric logratio coordinates and their inverse mapping.
}
\details{
Pivot coordinates map D-part compositional data from the simplex
into a (D-1)-dimensional real space isometrically. From our choice of pivot
coordinates, all the relative information about one of parts (or about two parts) is aggregated in the first coordinate
(or in the first two coordinates in case of symmetric pivot coordinates, respectively).
}
\examples{

require(MASS)
Sigma <- matrix(c(5.05,4.95,4.95,5.05), ncol=2, byrow=TRUE)
z <- pivotCoordInv(mvrnorm(100, mu=c(0,2), Sigma=Sigma))

data(expenditures)
## first variable as pivot variable
pivotCoord(expenditures)
## third variable as pivot variable
pivotCoord(expenditures, 3) 

x <- exp(mvrnorm(2000, mu=rep(1,10), diag(10)))
system.time(pivotCoord(x))
system.time(pivotCoord(x, fast=TRUE))

## without normalizing constant
pivotCoord(expenditures, norm = "orthogonal") # or:
pivotCoord(expenditures, norm = "1")
## other normalization
pivotCoord(expenditures, norm = "-sqrt((D-i)/(D-i+1))")

# symmetric balances (results in 2-dim symmetric pivot coordinates)
pivotCoord(expenditures, method = "symm")
}
\references{
Egozcue J.J., Pawlowsky-Glahn, V., Mateu-Figueras, G.,
Barcel'o-Vidal, C. (2003) Isometric logratio transformations for compositional
data analysis. \emph{Mathematical Geology}, \bold{35}(3) 279-300. 

Filzmoser, P., Hron, K., Templ, M. (2018) \emph{Applied Compositional Data Analysis}.
Springer, Cham.
}
\author{
Matthias Templ, Karel Hron, Peter Filzmoser
}
\keyword{math}
back to top