addconstraint: Adds constraints to the model.

Description Usage Arguments Value See Also Examples

View source: R/addconstraint.R

Description

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.

Usage

1

Arguments

x

A HMM object.

ct

The additional constraints, which can be either a matrix or a vector (see details).

Value

A HMM object similar to the input but with the additional constraints.

See Also

HMM, addtransition

Examples

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)

MobilePhoneESSnetBigData/destim documentation built on Dec. 7, 2020, 7:35 p.m.