computeCombPCA: Combined PCA for training and test sample

Description Usage Arguments Details Value Author(s) Examples

View source: R/computeCombPCA.R

Description

computeCombPCA computes combined PCA projections of the training and test samples.

Usage

1
computeCombPCA(x, y, robust)

Arguments

x

a matrix or a data.frame

y

a matrix or a data.frame

robust

a boolean indicating if robust PCA should be used or not

Details

The program is a simple alteration of PCAgrid() that computes a desired number of robust principal components using the grid search algorithm in the plane.

Value

PCA projections for each matrix

Author(s)

Rafael S. de Souza, Alberto Krone-Martins

Examples

1
2
3
4
5
6
7
8
#Multivariate data with outliers
library(mvtnorm)
x <- rbind(rmvnorm(100, rep(0, 6), diag(c(5, rep(1,5)))),
          rmvnorm( 15, c(0, rep(20, 5)), diag(rep(1, 6))))
y <- rbind(rmvnorm(100, rep(0, 6), diag(c(5, rep(1,5)))),
          rmvnorm( 15, c(0, rep(20, 5)), diag(rep(1, 6))))
#Here we calculate the principal components
pc <- computeCombPCA(x, y)

CosmoPhotoz documentation built on May 29, 2017, 3:59 p.m.