hcpp: R/Rcpp implementation of the HCP algorithm

Description Usage Arguments Details Value Author(s) References Examples

View source: R/hcpp.R

Description

Rcpp implementation of the HCP algorithm

Usage

1
2
3
hcpp(Z, Y, X, k, lambda1 = NULL, lambda2 = NULL, lambda3 = NULL,
  iter = 100, stand = TRUE, log = TRUE, fast = TRUE, verbose = TRUE,
  tol = 1e-06)

Arguments

Z

a matrix nxd of known covariates, where n is the number of subjects and d is the number of known covariates. *must be standardize (columns have 0 mean and constant SS).

Y

a matrix of nxg of expression data (must be standardized (columns scaled to have constant SS and mean 0). ** use standardize function to standardize F and Y.

X

vector of responses.

k

number of inferred hidden components (k is an integer)

lambda1

model parameter 1

lambda2

model parameter 2

lambda3

model parameter 3

iter

(optional) iter: number of iterations (default = 100);

stand

default standardize data TRUE

log

default log-transformation TRUE

fast

default use fast RcppArmadillo implementation

verbose

default TRUE

tol

1e-6 stopping criterium relative difference objective function

Details

Objective: This function solves the following problem: argmin_Z,B,U ||Y-Z*B||_2 + lambda1*||Z-F*U||_2 + lambda2*||B||_2 + lambda_3||U||_2

To use the residual data: Residual = Y - Z*B

Note: k>0, lambda1>0, lambda2>0, lambda3>0 must be set by the user based on the data at hand. one can set these values using cross-validation, by evaluating the "performance" of the resulting residual data on a desired task. typically, if lambda>5, then hidden factors match the known covariates closely.

Value

list Z: matrix of hidden components, dimensionality: nxk, B: matrix of effects of hidden components, dimensionality: kxg, o: value of objective function on consecutive iterations.

Author(s)

mvaniterson

References

http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0068141

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(rhcppdata)
F <- rhcppdata$F
Y <- rhcppdata$Y
k <- 10
lambda1 <- 20
lambda2 <- 1
lambda3 <- 1
iter <- 100
##and run
##Rres <- hcpp(Y, F, k, lambda1, lambda2, lambda3, iter)

mvaniterson/Rhcpp documentation built on Feb. 24, 2020, 4:06 p.m.