adjust: DEPRECATED Adjust a data to meet linear (in)equality...

Description Usage Arguments Value Details Note

Description

Adjust a vector \boldsymbol{x} to meet constraints \boldsymbol{Ax} ≤q \boldsymbol{b}. As of version 0.2 this function is deprecated. Please use

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
adjust(object, ...)

## S3 method for class 'editmatrix'
adjust(object, x, w = rep(1, length(x)),
  method = c("dense", "sparse"), ...)

## S3 method for class 'sparseConstraints'
adjust(object, x, w = rep(1, length(x)),
  tol = 0.01, maxiter = 1000L, ...)

## S3 method for class 'matrix'
adjust(object, b, x, neq = length(b), w = rep(1,
  length(x)), tol = 0.01, maxiter = 1000L, ...)

Arguments

object

an R object describing constraints (see details)

...

Arguments to be passed to other methods

x

The vector to be adjusted

w

A positive weight vector

method

use dense or sparse matrix method.

tol

The maximum allowed deviation from the constraints (see details).

maxiter

maximum number of iterations

b

Constant vector of the constraint system Ax≤q b

neq

the first neq linear relations are equalities.

Value

Object of class adjusted.

Details

adjust is a generic function allowing several definitions of the constraints in object.

The tolerance tol is defined as the maximum absolute value of the difference vector \boldsymbol{Ax}-\boldsymbol{b} for equalities. For inequalities, the difference vector is set to zero when it's value is lesser than zero (i.e. when the restriction is obeyed). The function keeps iterating until either the tolerance is met, the number of allowed iterations is exceeded or divergence is detected.

Note

adjust does not perform any consistency checks. When the system of constraints is contradictory (e.g. x>1 and x<0) this will result in either divergence or in exceeding the number of iterations.


rspa documentation built on June 19, 2019, 5:03 p.m.