scores_test: Calculate scores U on a new dataset based on supplied V from...

Description Usage Arguments Value Examples

View source: R/VarExplained.R

Description

Calculate scores U on a new dataset based on supplied V from SLIDE model

Usage

1
scores_test(V, pvec, Xtest)

Arguments

V

A n x p loadings matrix from fitted SLIDE model, part of the output of slide and slide_givenS

pvec

A vector of values p_1,....,p_d corresponding to the number of measurements within each view.

Xtest

- A ntest x p concatenated matrix of d views for which the scores U are desired

Value

A ntest x r matrix of orthogonal scores for Xtest, where r is the number of components (columns) in V

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
n = 25; p1 = p2 = 25
data = generateModel1(n = n, pvec = c(p1, p2))
# Specify binary structure
S = matrix(c(1,1,0,1,0,1),nrow = 2, ncol = 3)
fit_slide = slide_givenS(data$X, pvec = c(p1,p2), S = S)

# Generate new testing data
ntest = 30
data_test = generateModel1(n = ntest, pvec = c(p1, p2))
# Calculate scores on test data
U_test = scores_test(fit_slide$V, pvec = c(p1, p2), Xtest = data_test$X)

irinagain/SLIDE documentation built on Aug. 14, 2021, 2:56 p.m.