Report the distribution of values that follow occurrences of a sequence
Source:R/ctx_node.R
, R/ctx_node_cpp.R
counts.Rd
This function reports the number of occurrences of the sequence represented
by node
in the original time series used to build the associated context
tree (not including a possible final occurrence not followed by any value at
the end of the original time series). In addition if frequency=="detailed"
,
the function reports the frequencies of each of the possible value of the
time series when they appear just after the sequence.
Arguments
- node
a
ctx_node
object as returned byfind_sequence()
- frequency
specifies the counts to be included in the result.
"total"
gives the number of occurrences of the sequence in the original sequence."detailed"
includes in addition the break down of these occurrences into all the possible states.- local
specifies how the counts are computed. When
local
isFALSE
(default value) the counts include both counts that are specific to the context (if any) and counts from the descendants of the context in the tree. Whenlocal
isTRUE
the counts include only the number of times the context appears without being the last part of a longer context.
Value
either an integer when frequency="total"
which gives the total
number of occurrences of the sequence represented by node
or a
data.frame
with a total
column with the same value and a column for
each of the possible value of the original time series, reporting counts in
each column (see the description above).