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_nNumber of unstrained entries
var_iIndices of unconstrained entries
const_nNumber of constant entries
const_valValues of constant entries
const_iIndices of constant entries
pos_nNumber of positive entries (truncated below at 0)
pos_iIndices of positive entries
pos_nNumber 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.