Commit 023ae4a2 authored by Corson N. Areshenkoff's avatar Corson N. Areshenkoff

Add spd.pca.predict

parent df8a0b83
......@@ -4,8 +4,10 @@ export(spd.vectorize)
export(spd.estimate)
export(spd.interpolate)
export(spd.pca)
export(spd.pca.predict)
export(spd.logmap)
export(spd.expmap)
export(spddot)
importFrom(expm,expm)
importFrom(expm,logm)
......
#' Prediction for SPD kernel PCA
#'
#' Function accepts a fitted kpca object returned by \code{spd.pca} and a list of
#' SPD matrices and returns a matrix of estimated principal component scores.
#'
#' @param fit An object of class kpca return by spd.pca
#' @param x A list of SPD matrices for which to derive component scores.
#' @return A matrix of principal component scores
spd.pca.predict <- function(fit, x){
# Check input
if (!'spd.list' %in% input.type(x)){
stop('Invalid input type')
}
# Vectorize inputs
vecs <- t(sapply(x, function(i) spd.vectorize(i, scaling = F)))
return(predict(fit, vecs))
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spd-pca-predict.R
\name{spd.pca.predict}
\alias{spd.pca.predict}
\title{Prediction for SPD kernel PCA}
\usage{
spd.pca.predict(fit, x)
}
\arguments{
\item{fit}{An object of class kpca return by spd.pca}
\item{x}{A list of SPD matrices for which to derive component scores.}
}
\value{
A matrix of principal component scores
}
\description{
Function accepts a fitted kpca object returned by \code{spd.pca} and a list of
SPD matrices and returns a matrix of estimated principal component scores.
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment