\name{geodesic_pca_sphere}
\alias{geodesic_pca_sphere}
\title{
Principal geodesic analysis based subsphere projection
}

\description{
Principal geodesic analysis based subsphere projection.
}

\usage{
geodesic_pca_sphere(x, k = 2)
}

\arguments{
\item{x}{
A matrix containing directional data in the hyper-sphere.
}
\item{k}{
The dimensionality to which the data will be projected. For the sphere this should 2 (default value).
}
}

\details{
We use a geodesic-aware dimensionality reduction that combines Principal Geodesic Analysis
(Fletcher et al. 2004) with projection to a lower-dimensional sphere, similar in spirit to
Principal Nested Spheres (Jung et al. 2012) but using global optimization rather than
iterative reduction.
}

\value{
A matrix with the projected data onto the sphere (or a lower dimension hyper-sphere).
}

\references{
Jung S., Dryden I. L. and Marron J. S. (2012). Analysis of principal nested spheres.
Biometrika, 99(3): 551--568.

Fletcher P. T., Lu C., Pizer S. M. and Joshi S. (2004). Principal geodesic analysis for the study
of nonlinear statistics of shape. IEEE Transactions on Medical Imaging, 23(8): 995--1005.
}

\author{
Michail Tsagris.

R implementation and documentation: Michail Tsagris \email{mtsagris@uoc.gr}.
}

%\note{
%%  ~~further notes~~
%}

\seealso{
\code{\link{sphereplot}
}
}

\examples{
x <- as.matrix( iris[, 1:4] )
x <- x / sqrt( rowSums(x^2) )
y <- geodesic_pca_sphere(x)
sphereplot(y)
}

