Learn R Programming

CVXR (version 0.99-7)

Huber-class: The Huber class.

Description

This class represents the elementwise Huber function, \(Huber(x, M) = \)

  • \(2M|x|-M^2\)for \(|x| \geq |M|\)

  • \(|x|^2\)for \(|x| \leq |M|.\)

Usage

Huber(x, M = 1)

# S4 method for Huber validate_args(object)

# S4 method for Huber to_numeric(object, values)

# S4 method for Huber sign_from_args(object)

# S4 method for Huber is_atom_convex(object)

# S4 method for Huber is_atom_concave(object)

# S4 method for Huber is_incr(object, idx)

# S4 method for Huber is_decr(object, idx)

# S4 method for Huber get_data(object)

# S4 method for Huber graph_implementation(object, arg_objs, size, data = NA_real_)

Arguments

x

An '>Expression object.

M

A positive scalar value representing the threshold. Defaults to 1.

object

A '>Huber object.

values

A list of arguments to the atom.

idx

An index into the atom.

arg_objs

A list of linear expressions for each argument.

size

A vector with two elements representing the size of the resulting expression.

data

A list of additional data required by the atom.

Methods (by generic)

  • validate_args: Check that M is a non-negative constant.

  • to_numeric: The Huber function evaluted elementwise on the input value.

  • sign_from_args: The atom is positive.

  • is_atom_convex: The atom is convex.

  • is_atom_concave: The atom is not concave.

  • is_incr: A logical value indicating whether the atom is weakly increasing.

  • is_decr: A logical value indicating whether the atom is weakly decreasing.

  • get_data: A list containing the parameter M.

  • graph_implementation: The graph implementation of the atom.

Slots

x

An '>Expression or numeric constant.

M

A positive scalar value representing the threshold. Defaults to 1.