Learn R Programming

Biograph (version 2.0.6)

StateSpace: Get state space

Description

Obtains statespace from the data

Usage

StateSpace(d,newnamstates)

Arguments

d
Biograph object (e.g. Bdata) or vector of state sequences (e.g. Bdata$path)
newnamstates
The preferred sequence of states.

Value

namstates
Names of the states in the state space
absorbstates
List of absorbing states. It is NULL if there is no absorbing state.

Details

StateSpace derives statespace from the character vector 'path' in the Biograph object. In that vector, each state is uniquely identified by a single character (ASCII). The function finds the different characters. The sequence of states is determined by characters popping up first, second, etc. You may impose a preferred sequence by specifying the argument newnamstates. If no preferred sequence exists, newnamstates is missing from the argument list. The results are stored in two variables: numstates (number of states) and namstates (names of the states). The function also returns an object identifying the absorbing state (if any). A state that is entered but not left is an absorbing state.

Examples

Run this code
data(GLHS)
z<- StateSpace (GLHS)
data (NLOG98)
z<- StateSpace (NLOG98,c("H","A","C","M","K"))
z <- StateSpace (NLOG98$path)

Run the code above in your browser using DataLab