Learn R Programming

robflreg (version 1.3)

getPCA.test: Get the functional principal component scores for a given test sample

Description

This function is used to compute the functional principal component scores of a test sample based on outputs obtained from getPCA.

Usage

getPCA.test(object, data)

Value

A matrix of principal component scores for the functional data.

Arguments

object

An output object of getPCA.

data

An \(n \times p\)-dimensional data matrix for functional data \(X(s)\) (test sample), where \(n\) denotes the sample size and \(p\) denotes the number of grid points for \(X(s)\).

Author

Ufuk Beyaztas and Han Lin Shang

Details

See getPCA for details.

Examples

Run this code
sim.data <- generate.ff.data(n.pred = 5, n.curve = 200, n.gp = 101)
Y <- sim.data$Y
Y.train <- Y[1:100,]
Y.test <- Y[101:200,]
gpY = seq(0, 1, length.out = 101) # grid points
rob.fpca <- getPCA(data = Y.train, nbasis = 20, ncomp = 4,
gp = gpY, emodel = "robust")
rob.fpca.test <- getPCA.test(object = rob.fpca, data = Y.test)

Run the code above in your browser using DataLab