The seqprecorr
function returns the penalizing factor \(q(x)\), i.e. the difference between the proportions of downward and upward transitions (state changes).
The argument penalized
allows to chose between three strategies for computing \(q(x)\): only penalizing negative weights (in which case \(q(x)\) is the proportion of negative transitions), only rewarding (with negative penalties) positive transitions, and applying both positive and negative penalties. The transitions can be weighted and the type of transition weights used is selected with the method
argument. For weights based on transition probabilities, the way how theses probabilites are transformed into weights is controlled with weight.type
. To avoid a border effect, when any computed transition probability \(p\) is close from 1 (\(p > 1 - .1/d\)), all \(p\)'s are adjusted as \(p - p/d\), where \(d\) is the border.effect
parameter. With method="RANK"
, the weights are set as the differences between the to and from state undesirableness.
The precarity index of a sequence \(x\) is based on the complexity index (Gabadinho et al., 2010) \(c(x)\) (See the seqici
function), and the undesirableness \(a(x_1)\) of the starting state. It is defined as
$$prec(x) = \lambda a(x_1) + (1-\lambda) r(x)^\beta c(x)^\alpha$$
where \(r(x)\) is the correction factor (argument correction
) for the sequence. The \(\lambda\) parameter (argument otto
) determines the trade-off between the importance of the undesirableness of the starting state and of the corrected complexity index. Parameters \(\alpha\) and \(\beta\) (argument a
and b
) are exponent weights of respectively the complexity and the correction factor.
When correction = NULL
(default), \(r(x)\) is determined as \(r(x) = 1 + q(x)\), where the penalty \(q(x)\) is the degrading index.
When correction = NULL
and type=2
, the correction is set as \(r(x) = (1 + q(x))/2\).
When stprec
is a vector, negative values indicate non-comparable sates that receive each the mean positive undesirableness value. After this transformation, the vector is normalized such that the minimum is 0 and the maximum 1.
When equivalent classes are provided, the class mean undesirableness degree is assigned to each state of the class (see seqprecstart
). For the count of transitions a same state value is assigned to all equivalent states.
Non-comparable states (those not listed on the state.order
argument and not equivalent to a listed state) all receive the mean undesirableness value. For the count of transitions, transitions from and to non-comparable states are ignored and replaced by a transition between the states that immediately precede and follow a spell in non-comparable states.
When there are missing states in the sequences, set with.missing = TRUE
to treat the missing state as an additional state. In that case the missing state will be considered as non-comparable unless you include the nr
attribute of seqdata
in state.order
or state.equiv
. With with.missing = FALSE
, transitions to and from the missing state will just be ignored and the undesirableness value of the first valid state will be used as starting undesirableness.