TraMineR (version 2.2-0.1)

seqivolatility: Volatility of individual state sequences

Description

Returns Brzinsky-Fay's objective volatility of each sequence.

Usage

seqivolatility(seqdata, type=1, w=.5, with.missing=FALSE)

Arguments

seqdata

a state sequence object (stslist) as returned by seqdef.

type

either 1 or 2. The default type=1 is the indicator adjusted such that it can reach its bounds 0 and 1. Type 2 is the unadjusted indicator (see Details).

w

real in the range [0, 1]. Weight given to the proportion of states visited (see Details).

with.missing

logical: should non-void missing values be treated as a regular state? If FALSE (default) missing values are ignored.

Value

A numeric vector with the volatility of each sequence.

Details

The (objective) volatility is the weighted average between the proportion \(pvisited\) of states visited and the frequency \(ftrans\) of transitions (state changes). Formally,

$$volatility = w \cdot pvisited + (1-w) \cdot ftrans$$

The proportion of states visited is computed as \((visited - 1)/(|a| - 1\)) when type=1 and as \(visited / |a|\) when type=2. Here, \(visited\) is the number of states visited and \(|a|\) the size of the alphabet.

The frequency of transition is \(ftrans = \frac{transn}{max.transn}\) where \(transn\) is the number of transitions (state changes) within the sequence, and \(max.transn\) the maximum possible transitions in the sequence.

For the normative volatility computed for a set of positive states, see seqipos.

References

Brzinsky-Fay, C. Unused Resources: Sequence and Trajectory Indicators. International Symposium on Sequence Analysis and Related Methods, Monte Verita, TI, Switzerland, Oct 10-11, 2018

See Also

seqintegration, seqipos, seqindic

Examples

Run this code
# NOT RUN {
data(ex1)
sx <- seqdef(ex1[,1:13], right="DEL")

seqivolatility(sx)
seqivolatility(sx, type=2)
seqivolatility(sx, with.missing=TRUE)
seqivolatility(sx, w=.7, with.missing=TRUE)

# }

Run the code above in your browser using DataLab