Run_LORS: Run_LORS

Description Usage Arguments Value Examples

View source: R/FastLORS_Functions.R

Description

Run_LORS is a function used to run either FastLORS or LORS

Usage

1
2
3
Run_LORS(Y, X, method = "FastLORS", screening = "LORS-Screening",
  tune_method = "FastLORS", seed = 123, maxiter = 10000,
  eps = 2.2204e-16, tol = 1e-04, cross_valid = TRUE, omega_SOR = 1.999)

Arguments

Y

gene expression matrix

X

matrix of SNPs

method

chooses with modeling method to run

screening

Either "LORS-Screening", "HC-Screening", or "None". The default method, LORS-Screening, is recommended if the number of SNPs is large. HC-Screening of Rhyne et al. (2018) is under development but is included here as an option.

tune_method

chooses whether FastLORS should be used for parameter tuning or the original LORS procedure should be used. Default is FastLORS

seed

random seed to be used for setting training and validation set. Default is 123.

maxiter

maximum number of iterations

eps

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

tol

tolerance level for convergence

cross_valid

chooses whether cross-validation should be used in parameter tuning. Default is TRUE.

omega_SOR

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

Value

LORS_Obj or Fast_LORS_Obj

A list produced from LORS or FastLORS containing (1) B: estimate of the coefficient matrix (2) L: estimate of the matrix of hidden factors (3) mu: estiamte of the vector of intercepts (4) f_val_vec: objective function values and (5) res_vec: relative change in objective function values

selectedSNPs

The SNPs selected by the screening method

screening_time

The time (in seconds) spent on screening step

param_time

The time (in seconds) spent on the parameter tuning step

model_time

The time (in seconds) spent on the joint modeling step

total_time

The time (in seconds) spent on the screening, parameter tuning, and joint modeling steps

rho

The value of rho chosen through parameter tuning

lambda

The value of lambda chosen through parameter tuning

Examples

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

## Generate some data
n <- 20
p <- 50
q <- 30
k <- 4
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

## Usage
Run_LORS(Y, X, method = "FastLORS")

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