Description Usage Arguments Value See Also Examples
View source: R/addconstraint.R
The specified constraints are added to the model.
If parameter ct
is a vector, it is expected to be a set of transition
probabilities indexed as in field transitions of the model. In this
case the constraint added is the equality between the referred probabilities of
transition.
If parameter ct
is a matrix, it is expected to be a system of additional
linear equalities that the model must fulfill. Thus, the new equations
are added to the field constraints of the model.
While it is possible to use a matrix to add equality constraints, it is not
recommended because of performance.
Previous constraints of the model are preserved.
1 | addconstraint(x, ct)
|
x |
A HMM object. |
ct |
The additional constraints, which can be either a matrix or a vector (see details). |
A HMM object similar to the input but with the additional constraints.
HMM, addtransition
1 2 3 4 5 6 7 8 | model <- HMM(3)
model <- addtransition(model, c(1,2))
model <- addtransition(model, c(2,3))
model <- addtransition(model, c(3,1))
transitions(model)
constraints(model)
model <- addconstraint(model,c(2,4,5))
constraints(model)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.