create.constraints {CLME} | R Documentation |
Generate common order constraints
Description
Automatically generates the constraints in the format used by clme
. Allowed orders are simple, simple tree, and umbrella orders.
Usage
create.constraints(P1, constraints)
Arguments
P1 |
the length of |
constraints |
List with the elements |
Details
The elements of constraints
are:
-
order
: string. Currently “simple”, “simple.tree” and “umbrella” are supported. -
node
: numeric, the node of the coefficients (unnecessary for simple orders). -
decreasing
: logical. For simple orders, is the trend decreasing? For umbrella and simple tree, does the nodal parameter have the greatest value (e.g., the peak, instead of the valley)?
See clme
for more information and a depiction of these three elements.
Value
The function returns a list containing the elements of input argument constraints
as well as
-
A
matrix of dimensionr \times 2
containing the order constraints, where r is the number of linear constraints. -
B
matrix containing the contrasts necessary for computation of the Williams' type test statistic (may be identical toA
). -
Anull
matrix similar toA
which defines all possible constraints. Used to obtain parameter estimates under the null hypothesis. -
order
the input argument forconstraints\$order
. -
node
the input argument forconstraints\$node
. -
decreasing
the input argument forconstraints\$decreasing
See w.stat
for more information on B
Note
The function clme
also utilizes the argument constraints
. For clme
, this argument may either be identical to the argument of this function, or may be the output of create.constraints
(that is, a list containing appropriate matrices A
, Anull
, and if necessary, B
).
An example the the A
matrix might be:
[1,] | [,1] | [,2] |
[2,] | 1 | 2 |
[3,] | 2 | 3 |
[4,] | 4 | 3 |
[5,] | 5 | 4 |
[6,] | 6 | 5 |
This matrix defines what CLME describes as a decreasing umbrella order. The first row defines the constraint that \theta_1 \leq \theta_2
, the second row defined the constraint \theta_2 \leq \theta_3
, the third row defines \theta_4 \leq \theta_3
, and so on. The values are indexes, and the left column is the index of the parameter constrained to be smaller.
See Also
Examples
## Not run:
# For simple order, the node does not matter
create.constraints( P1 = 5, constraints = list( order='simple' ,
decreasing=FALSE ))
# Compare constraints against decreasing=TRUE
create.constraints( P1 = 5, constraints=list( order='simple' ,
decreasing=TRUE ))
# Umbrella order
create.constraints( P1 = 5, constraints=list( order='umbrella' , node=3
, decreasing=FALSE ))
## End(Not run)