tsmvr: Truly Spare MultiVariate Regression

Description Usage Arguments Value Note

View source: R/tsmvr.R

Description

Calculates sparse solutions to the multivariate regression problem with correlated errors. Let X be the n-by-p predictor matrix, Y be the n-by-q response matrix, B be the p-by-q regression matrix, and Ω be the q-by-q precision matrix (inverse of the covariance matrix Σ). Let s1 be a sparsity parameter that only allows the top s1 values for B in aboslute value be nonzero, and lets s2 be defined similarly for Ω. Then this functions calculates the solution to

(B_hat,Ω_hat) = argmin_(B,Ω) (1/n*Tr[(Y-XB)^T*Ω*(Y-XB)] - log|Ω

|) such that ||B||_(1,1) ≤ s1 and ||Ω||_(1,1) ≤ s2. Here || * ||_(1,1) indicates the 1-1 "norm" that counts the number of nonzero matrix entries.

Usage

1
2
tsmvr(X, Y, s1 = NULL, s2 = NULL, s1_vec = NULL, s2_vec = NULL,
  method = c("single", "gs"), pars, quiet = FALSE, seed = NULL)

Arguments

X

n-by-p predictor matrix

Y

n-by-q response matrix

s1

sparsity for p-by-q regressor matrix B (positive integer or NULL)

s2

sparsity for q-by-q precision matrix Omega (positive integer or NULL)

s1_vec

s1 values for gridsearch (vector of integer valued numerics or NULL)

s2_vec

s2 values for gridsearch (vector of integer valued numerics or NULL)

method

method of solver ('single' is to solve a single problem, 'gs' is to perform gridsearch)

pars

list of algorithm parameters as constructed by the set_parameters function

quiet

whether not to print statuses to the screen (bool)

seed

set random seed (integer or NULL)

Value

A list containing the mean and sd of the error over the replicates as well as the means and standard deviations of the errors across each fold.

Note

See also set_parameters.


spcorum/tsmvr documentation built on Aug. 31, 2019, 8:58 p.m.