Learn R Programming

RMCLab (version 0.1.0)

lambda_grid: Construct grid of values for the regularization parameter

Description

Construct a grid of values for the regularization parameter in rdmc() or soft_impute().

Usage

fraction_grid(
  min = 0.01,
  max = 1,
  nb_lambda = 10L,
  log = TRUE,
  reverse = FALSE
)

mult_grid(min = 0.05, factor = 1.5, nb_lambda = 10L)

Value

A numeric vector of values for the regularization parameter.

Arguments

min

numeric; the smallest value of the regularization parameter. For fraction_grid(), it must be in the interval (0, 1) with the default being 0.01. For mult_grid(), it must be larger than 0 with the default being 0.05.

max

numeric; the largest value of the regularization parameter. It must be in the interval (min, 1] with the default being 1.

nb_lambda

a positive integer giving the number of values for the regularization parameter to be generated.

log

a logical indicating whether the grid of values should be on a logarithmic scale (defaults to TRUE).

reverse

a logical indicating whether the grid of values should be in ascending order (FALSE, the default) or in descending order (TRUE).

factor

numeric; multiplication factor larger than 1 to be used to construct the values of the regularization parameter. That is, the second value is obtained by multiplying min by factor, with this process being iterated further.

Details

Function fraction_grid() generates a grid of values in the interval (0, 1], either on a logarithmic or linear scale, which rdmc() and soft_impute() can relate to a certain reference value computed from the data at hand.

Function mult_grid() generates a multiplicative grid in which the each value is obtained by multiplying the previous value with a specified factor.

See Also

rdmc(), rdmc_tune(), soft_impute(), soft_impute_tune()

Examples

Run this code
fraction_grid()
fraction_grid(log = FALSE)
mult_grid(factor = 2)

Run the code above in your browser using DataLab