objective.function: Computes the coefficient terms of the objective functions

View source: R/optim.R

objective.functionR Documentation

Computes the coefficient terms of the objective functions

Description

This function computes the matrices in the objective functions for linear programs. This function takes matrix \bm{A} and \bm{β} as input and computes the coefficients of the objective function.

Usage

objective.function(A, b, n, weight = NULL)

Arguments

A

The matrix \bm{A}.

b

The column vector \bm{β}.

n

The sample size n.

weight

The weighting matrix.

Details

  • Quadratic programs — Given inputs \bm{A} \in \mathbf{R}^{m\times m}, \bm{b} \in \mathbf{R}^m and \bm{W} \in \mathbf{R}^{m\times m}, the equation of the objective function of the quadratic program can be written as

    n (\bm{A}\bm{x} -\bm{β})'\bm{W}(\bm{A}\bm{x}-\bm{β}) = n\bm{x}'\bm{A}'\bm{W}\bm{A}\bm{x} - 2n\bm{β}'\bm{W}\bm{A}\bm{x} + n\bm{β}'\bm{W}\bm{β}.

    If the \bm{W} matrix is not specified, then it will be taken as an identity matrix of order m.

  • Linear programs — For all linear problems that are considered in this code, one of \bm{A} and \bm{b} is NULL or is a zero vector. The term that is nonzero and nonnull will be multiplied by n and used as obj1.

Value

Returns the following three quantities: obj2 is the coefficient of the quadratic term, obj1 is the coefficient of the linear term and obj0 is the constant term. More explicitly, their form are given as follows:

obj2

The coefficient for the second-order term. It is returned as NULL for linear programs and n\bm{A}'\bm{W}\bm{A} for quadratic programs.

obj1

The coefficient term of the linear term. For quadratic programs, it is returned as -2n\bm{β}'\bm{W}\bm{A}.

obj0

The constant term of the linear program. For quadratic programs, it is returned as n\bm{β}'\bm{W}\bm{β}.


conroylau/lpinfer documentation built on Oct. 23, 2022, 9:21 a.m.