Description Usage Arguments Value
View source: R/latent_factor.R
This is minimizing ||Y - Phi * W^T||_2^2 + lambda * ||W||_1 over W and Phi, by alternatively minimizing over each term. Note that Phi is fixed across people for each time, which is why it is a shorter dimension than Y. I.e., this model can also be written as y_ijt = phi_t ^ T w_j + noise.
1 |
Y |
An N x J real matrix, with censored values set to NA. The standard application we have in mind is the sample x OTU count matrix. |
time_mask |
An N x T matrix, where T is the unique number of time points across all samples, where the it^th entry is 1 is sample i was taken at time i. |
Phi0 |
The initial value of Phi, the basis matrix. |
n_iter |
The number of iterations to run the alternating minimization. |
model_funs |
A list of functions that, when given a matrix x and vector y, will return the coefficients of x on y. Must have two elemets "Phi" and "W" for fitting the two parts of the alternating minimization. |
A list with the following elements,
$Phi The learned basis matrix across times.
$W The learned coefficients matrix.
$obj The RSS, and l1 / l2 of W across iterations.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.