Fast_LORS: Fast_LORS

Description Usage Arguments Value Examples

View source: R/FastLORS_Functions.R

Description

Fast_LORS is a function for solving the LORS optimization problem in Can Yang et al. (2013) through the proximal gradient method

Usage

1
2
Fast_LORS(Y, X, rho, lambda, maxiter = 5000, eps = 2.2204e-16,
  tol = 1e-04, verbose = FALSE, omega_SOR = 1.999)

Arguments

Y

gene expression matrix

X

matrix of SNPs

rho

parameter for enforcing sparsity of coefficient matrix

lambda

parameter for enforcing low-rank structure of hidden factor matrix

maxiter

maximum number of iterations

eps

constant used when checking the convergence. Ensures no division by 0.

tol

tolerance level for convergence

verbose

chooses whether details should be printed to console. Default is FALSE.

omega_SOR

the value of omega to use if applying successive over-relaxation with FastLORS.

Value

B

The estimated coefficients

mu

The estimated intercept

L

The estimated matrix of hidden factors

f_val_vec

The objective function values

res_vec

The relative change in objective function values

iter

The number of iterations

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
##Example

## Generate some data
n <- 50
p <- 200
q <- 100
k <- 10
set.seed(123)
X <- matrix(rbinom(n*p,1,0.5),n,p)
L <- matrix(rnorm(n*k),n,k) %*% t(matrix(rnorm(q*k),q,k))
B <- matrix(0, ncol(X), ncol(L))
activeSNPs <- sort(sample(c(1:nrow(B)), 20))
for(i in 1:length(activeSNPs)){
genes_influenced <- sort(sample(c(1:ncol(B)),5))
B[activeSNPs[i], genes_influenced] <- 2
}
E <- matrix(rnorm(n*q),n,q)
Y <- X %*% B + L + E

rho <- runif(1,3,5)
lambda <- runif(1,3,5)

## Usage
Fast_LORS(Y, X, rho, lambda)

jdrhyne2/FastLORS documentation built on March 5, 2020, 6:50 a.m.