mcnnm_fit: This function trains a model for a specified value of...

Description Usage Arguments Value See Also Examples

View source: R/RcppExports.R

Description

This function trains a model for a specified value of lambda_L. The result contains L, u, v, and lambda_L. The only difference with mcnnm is that this function trains only for a specified value of lambda_L.

Usage

1
2
mcnnm_fit(M, mask, lambda_L, 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.

lambda_L

Required parameter for fitting the model as this function computes the result for a specified value of lambda_L.

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 fitted model for the given value of lambda_L.

See Also

mcnnm

Examples

1
mcnnm_fit(M = replicate(5,rnorm(5)), mask = matrix(rbinom(5*5,1,0.8),5,5), lambda_L = 0.5)

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