objective.function | R Documentation |
This function computes the matrices in the objective functions
for linear programs. This function takes matrix \bm{A}
and
\bm{\beta}
as input and computes the coefficients of the objective
function.
objective.function(A, b, n, weight = NULL)
A |
The matrix |
b |
The column vector |
n |
The sample size |
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{\beta})'\bm{W}(\bm{A}\bm{x}-\bm{\beta})
= n\bm{x}'\bm{A}'\bm{W}\bm{A}\bm{x} - 2n\bm{\beta}'\bm{W}\bm{A}\bm{x} +
n\bm{\beta}'\bm{W}\bm{\beta}.
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 |
obj0 |
The constant term of the linear program. For quadratic
programs, it is returned as |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.