TransitionSystem-class.Rd
Reference class containing some properties and methods required for analysing, modelling, simulating and visualising a Transition Sytem. A Transistopn System is the more general case of a Markov Chain model descibing a system which can change status over time.
history
data.frame
holding history data of status transitions
report
list
list of data.frames containing outputs of various query reports. These tables could be:
nodes
: data.frame
holding nodes of a transition system network. Nodes are equivalent to statuses.
links
: data.frame
holding links of a transition system network. Links(edges) are equivalent to transitions.
feed.transition_events(
dataset,
caseID_col = "caseID",
status_col = "status",
startTime_col = "startTime",
caseStartFlag_col = NULL,
caseEndFlag_col = NULL,
caseStartTags = NULL,
caseEndTags = NULL,
remove_sst = F,
extra_col = NULL
)
Feeds an eventlog as a data.frame or tibble to train the transition system model.
Arguments:
dataset (data.frame)
: The input eventlog data table.
caseID_col (character)
: Header of the column in dataset
containing case IDs.
status_col (character)
: Header of the column in dataset
containing source status of the transition event.
startTime_col (character)
: Header of the column in dataset
containing time-stamp when transition starts.
This is the time when the case has arrived into the source status.
caseStartFlag_col (character)
: Header of the column specifying which cases
are started/born/arrived within the Time-line Coverage Window (TCW).
caseEndFlag_col (character)
: Header of the column specifying which cases
are ended/dead/finished/completed within the Time-line Coverage Window (TCW).
caseStartTags, caseEndTags (character)
: Alternatively, you can specify which statuses are starting/ending statuses.
If this is specified, cases starting/ending with statuses within the given lists,
will be considered as cases started/ended within the timeline window of analysis.
If both caseStartFlag_col
and caseStartTags
are specified, caseStartTags
will be ignored
(Similarly, for caseStartFlag_col
and caseStartTags
).
remove_sst (logical)
: If set to TRUE, same status transitions will be removed.
extra_col (character)
: list of additional columns to be added to the transition history table
get.case.status.duration()
Returns a table containing duration of each case on each status
get.case.status.time()
Returns entry time of each case to each status in a matrix
get.links(full = F)
Returns the transition profile which is a data frame containing features associated with the transitions of cases from one status to other.
Each transition stablish a link in the process map graph from which you can build a Markov-Chain (MC)
model and use it to determine the steady state probabilities or run a memory-less process simulation.
If you run this method once, the output table will be accessible via report$links
.
If the function is called for the second time, it returns the same table as before if you do not reset the object.
Arguments:
* full (logical)
: If set to TRUE
, case filtering is ignored and all cases will be considered in computing the statistics.
Output:
(data.frame)
: Includes the following columns
(columns with keyword case
are generated only if settings$include_case_measures
is TRUE
):
meanCaseFreq
: average transition count per case medCaseFreq
: median case transition frequency
(half of cases have transition frequency higher than this value) sdCaseFreq
: standard deviation of transition frequencies among cases totalTime
: Total transition time meanCaseTime
: average transition time per case medCaseTime
: median case transition time (half of cases have transition time higher than this value) sdCaseTime
: standard deviation of transition time among cases meanTime
: average: transition time per transition medTime
: median transition time (half of transitions have transition time higher than this value) sdTime
: standard deviation of transition time among transitions(half of transitions have transition time higher than this value) meanCaseEntryFreq
: how many times in average a case has entered this status
get.longest_path()
Returns the longest sequence observed
get.nodes(full = F)
Returns the status profile which is a data frame containing features associated with the statuses of the transition system.
Each status stablish a node in the process map graph from which you can build a Markov-Chain (MC)
model and use it to determine the steady state probabilities or run a memory-less process simulation.
If you run this method once, the output table will be accessible via report$nodes.
If the function is called for the second time, it returns the same table as before if you do not reset the object.
Arguments:
* full (logical)
: If set to TRUE
, case filtering is ignored and all cases will be considered in computing the statistics.
Output:
(data.frame)
: Includes the following columns
(columns with keyword case
are generated only if settings$include_case_measures
is TRUE
):
totExitFreq
: Over all cases, total count of transitions from the status to other statuses.
totEntryFreq
: Over all cases, total count of transitions into the status from other statuses .
totalDuration
: Sum of duration(time) that cases spent in the status.
meanDuration
: Average duration(time) that each case spent in the status.
medDuration
: Median of duration(time) that cases spent in the status.
sdDuration
: Standard deviation of duration(time) that cases were in the status.
nCaseEntry
: How many cases have at least once entered into the status.
nCaseExit
: How many cases have at least once exited from the status.
meanExitCaseFrequency
: indicates how many times in average, each case has exited from the status
get.status.case.time()
Returns entry time to each status for each case in a matrix (transpose of 'case.status.time')
get.transition_matrix(
measure = c("rate", "freq", "time"),
aggregator = c("sum", "mean", "median", "sd"),
remove_ends = F,
full = F
)
Returns the square Adjecancy Matrix
associated with the transition system. It returns the same information that method get.links() provides but in a square matrix.
Arguments:
measure (character)
: one of the three options: 'rate'
, 'freq'
or 'time'
.
The default is 'rate'
. Any other value will raise a value error.
- 'rate'
: the returned matrix contains rates of transitions from one status to itself or another status as
percentages of total cases in the origin status.
For example, if A and B are two statuses in the transition system,
the value of cell in row A and column B shows what fraction of cases transitioned from status A to B.
- 'freq'
: the returned matrix contains raw frequencies of case transitions.
- 'time'
: the returned matrix contains aggregated durations of case transitions.
aggregator (character)
: Only used when measure
is set to 'time'
.
Can be one of these options 'sum', 'mean', 'median', 'sd'
This specifies aggregator to aggregate transition times (durations).
For example if measure = 'time'
and aggregator = 'mean'
,
the value of cell in row A and column B shows the average transition time from status A to B
(average time cases spent in status A before migrating to status B)
remove_ends (boolean)
: If set to TRUE
, then the rows and columns
associated with the START, END, ENTER and EXIT statuses will be eliminated from the adjacency matrix.
random_walk(starting_status = "START", num_steps = 1)
Runs a random walk analysis starting from a given status and returns a dataframe containing probability distributions over statuses at each step
Arguments:
starting_status (character)
: must be one of statuses defined in the transition system.
The default is 'START'
.
num_steps (integer)
: Number of steps in the random walk.