Description Usage Arguments Value See Also Examples
This function trains all models for given vectors of lambda_L and lambda_H. Each model contains L, H, u, v, lambda_H, and lambda_L.
1 2 3 4 | mcnnm_wc(M, X, Z, mask, num_lam_L = 30L, num_lam_H = 30L,
lambda_L = as.numeric(c()), lambda_H = as.numeric(c()),
to_normalize = 1L, to_estimate_u = 1L, to_estimate_v = 1L,
to_add_ID = 1L, niter = 100L, rel_tol = 1e-05, is_quiet = 1L)
|
M |
Matrix of observed entries. The input should be N (number of units) by T (number of time periods). |
X |
Matrix containing unit-related covariates. The number of rows of X should match with the number of units (number of rows of M). If unit-related covariates do not exist X = matrix(0L,0,0) should be used as input. |
Z |
Matrix containing time-related covariates. The number of rows of Z should match with the number of time periods (number of columns in M). If time-related covariates do not exist use Z = matrix(0L,0,0) |
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 30 and lambda_L values are from minimum number which makes L zero to 1e-3 times this minimum number. |
num_lam_H |
Optional parameter on the number of lambda_Hs to consider for learning. The default number is 30 and lambda_H values are from minimum number which makes H 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. |
lambda_H |
Optional numeric vector containing all lambda_H 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_H and the rule explained above is used. However, once this vector is passed by user manually, num_lam_H argument will not be used. |
to_normalize |
Optional boolean parameter indicating whether to normalize covariates or not (columns of X and Z). The default value is 1. If this value is set to 0, the result would be sensitive to scales in covariates. |
to_estimate_u |
Optional boolean input for wheter estimating fixed unit effects (row means of M) or not. Default is 1. |
to_add_ID |
Optional boolean parameter indicating whether identity matrices are concatenated with X and Z in the model X * H * Z'. The default value is true (identity matrices are concatenated) and the model becomes X*H_X + X*H_XZ*Z^T+ H_Z Z^T (the rest of matrix in H forced to zero). |
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). |
The list of all models trained with the given vector of lambda_Ls and lambda_Hs.
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.