Description Usage Arguments Value Examples
Given a matrix (described below), this will create a list of vectors which give the locations of unconstrained, constrant, positive, and negative elements.
1 |
x |
Numeric |
list
with elements
var_n
Number of unstrained entries
var_i
Indices of unconstrained entries
const_n
Number of constant entries
const_val
Values of constant entries
const_i
Indices of constant entries
pos_n
Number of positive entries (truncated below at 0)
pos_i
Indices of positive entries
pos_n
Number of negative entries (truncated above at 0)
1 2 3 4 5 6 7 8 9 | constraints <- matrix(NA, 4, 2)
# constants
constraints[1, 1] <- 1
constraints[1, 2] <- 0
# positive values
constraints[2, 1] <- Inf
# negative values
constraints[2, 2] <- -Inf
flatten_constraints(constraints)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.