% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/diss_projection.R
\name{diss_pca}
\alias{diss_pca}
\title{PCA dissimilarity method constructor}
\usage{
diss_pca(
  ncomp = ncomp_by_var(0.01),
  method = c("pca", "pca_nipals"),
  center = TRUE,
  scale = FALSE,
  return_projection = FALSE
)
}
\arguments{
\item{ncomp}{Component selection method. Can be:
\itemize{
\item A positive integer for a fixed number of components
\item \code{\link{ncomp_fixed}(n)}: explicit fixed selection
\item \code{\link{ncomp_by_var}(min_var)}: retain components explaining
at least \code{min_var} variance each (default: \code{ncomp_by_var(0.01)})
\item \code{\link{ncomp_by_cumvar}(min_cumvar)}: retain components until
cumulative variance reaches \code{min_cumvar}
\item \code{\link{ncomp_by_opc}()}: optimize using side information
(\code{Yr} required in \code{dissimilarity()})
}}

\item{method}{Character. PCA algorithm: \code{"pca"} (default, SVD-based) or
\code{"pca_nipals"} (NIPALS algorithm).}

\item{center}{Logical. Center data before projection? Default \code{TRUE}.}

\item{scale}{Logical. Scale data before projection? Default \code{FALSE}.}

\item{return_projection}{Logical. Return the projection object?
Default \code{FALSE}.}
}
\value{
An object of class \code{c("diss_pca", "diss_method")}.
}
\description{
Creates a configuration object for computing dissimilarity based on
Mahalanobis distance in PCA score space.
}
\examples{
# Fixed number of components
diss_pca(ncomp = 10)
diss_pca(ncomp = ncomp_fixed(10))

# Retain components explaining >= 1\% variance each (default)
diss_pca(ncomp = ncomp_by_var(0.01))

# Retain components until 99\% cumulative variance
diss_pca(ncomp = ncomp_by_cumvar(0.99))

# Optimize using side information (requires Yr)
diss_pca(ncomp = ncomp_by_opc(40))
diss_pca(ncomp = ncomp_by_opc())

# NIPALS algorithm (useful for very large matrices)
diss_pca(ncomp = 10, method = "pca_nipals")

}
\seealso{
Component selection: \code{\link{ncomp_by_var}}, \code{\link{ncomp_by_cumvar}},
\code{\link{ncomp_by_opc}}, \code{\link{ncomp_fixed}}

Other dissimilarity methods: \code{\link{diss_pls}},
\code{\link{diss_correlation}}, \code{\link{diss_euclidean}},
\code{\link{diss_cosine}}, \code{\link{diss_mahalanobis}}
}
