objective.function | R Documentation |
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.
objective.function(A, b, n, weight = NULL)
A |
The matrix \bm{A}. |
b |
The column vector \bm{β}. |
n |
The sample size n. |
weight |
The weighting matrix. |
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
.
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 |
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{β}. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.