addtransition: Adds a transition to the model.

Description Usage Arguments Value See Also Examples

View source: R/addtransition.R

Description

The specified transition is added to the model as a transition with non zero probability. Since the transition probabilities from the initial state of the newly specified transition still have to sum up to one, the correspondent constraint is modified accordingly. It is not recommended to use this function to define a big model, as it is much slower than specifying all transitions in advance.

Usage

1

Arguments

x

A HMM object.

t

The transition, as a two dimensional integer vector. The first element is the number of the initial state and the second one the number of the final state.

Value

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

See Also

HMM, addconstraint

Examples

1
2
3
4
5
6
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)

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