mcnnm: This function trains all models for a given vector of...

Description Usage Arguments Value Examples

View source: R/RcppExports.R

Description

This function trains all models for a given vector of lambda_L. Each model contains L, u, v, and lambda_L.

Usage

1
2
3
mcnnm(M, mask, num_lam_L = 100L, lambda_L = as.numeric(c()),
  to_estimate_u = 1L, to_estimate_v = 1L, niter = 1000L,
  rel_tol = 1e-05, is_quiet = 1L)

Arguments

M

Matrix of observed entries. The input should be N (number of units) by T (number of time periods).

mask

Binary mask with the same shape as M containing observed entries.

num_lam_L

Optional parameter on the number of lambda_Ls to consider for learning. The default number is 100 and lambda_L values are from minimum number which makes L zero to 1e-3 times this minimum number.

lambda_L

Optional numeric vector containing all lambda_L values that user want to train model on sorted decreasingly (important for warm-start). By default this is empty (user need not to provide this) and num_lam_L and the rule explained above is used. However, once this vector is passed by user manually, num_lam_L argument will not be used

to_estimate_u

Optional boolean input for wheter estimating fixed unit effects (row means of M) or not. Default is 1.

niter

Optional parameter on the number of iterations taken in the algorithm for each fixed value of lambda_L. The default value is 1000 and it is sufficiently large as the algorithm is using warm-start strategy.

rel_tol

Optional parameter on the stopping rule. Once the relative improve in objective value drops below rel_tol, execution is halted. Default value is 1e-5.

is_quiet

Optional boolean input which indicates whether to print the status of learning and convergence results for Cyclic Coordinate Descent algorithm or not. The default value is 1 (no output is printed).

Value

The list of all models trained with the given vector of lambda_Ls.

Examples

1
mcnnm(M = replicate(5,rnorm(5)), mask = matrix(rbinom(5*5,1,0.8),5,5), lambda_L = c(10,5,1,0.5,0.1,0.05))

susanathey/MCPanel documentation built on May 29, 2019, 9:51 a.m.