InequalityConstr {SGB} | R Documentation |
Inequality constraints and jacobian
Description
Setting of inequality constraints on shape parameters.
hin.SGB
sets inequality constraints on the shape parameters in a SGB regression.
hin.SGB.jac
defines the corresponding Jacobian.
Usage
hin.SGB(x, d, u, bound, ...)
hin.SGB.jac(x, d, u, ...)
Arguments
x |
vector of parameters ( |
d |
data matrix of explanatory variables (without constant vector) |
u |
data matrix of compositions (independent variables) |
bound |
the estimates of shapes are constrained by |
... |
not used. |
Details
These functions are invoked internally by regSGB
with bound
specified by the user.
shape1
is constrained to be larger than 0.1, in order to avoid numerical problems and shape2
must be positive.
Moments of ratios of parts only exist up to bound
. Thus bound = 2.1
guarantees the existence of variances of ratios of parts.
Value
hin.SGB
: vector of length D+1
with the current value of c(shape1-0.1,shape1*shape2-bound)
. It should be non-negative at convergence of the regression algorithm.
hin.SGB.jac
: corresponding jacobian matrix of dimensions (D+1) \times
length(x)
.
Examples
## Parameter vector for a 3 parts composition with one explanatory variable (+ intercept):
x <- c(1,3.2,0.04,0.05,6,7:9)
bound <- 2.1
u <- t(c(0.1,0.5,0.4)) # only used to compute the number of parts.
hin.SGB(x, d, u, bound)
# = c(shape1-0.1, shape1*shape2-bound,shape2)
# all must be positive.