| countsTab | R Documentation |
Creates a tibble containing all unique sequences of length d+1 found in
the sample, along with their absolute frequencies.
countsTab(X, d)
X |
A numeric vector, a single-column data frame, or a list with a sample from a Markov chain. The first element must be the most recent observation. |
d |
A positive integer specifying the number of elements in each sequence,
which will be |
The function generates a tibble with d+2 columns. In the first
d+1 columns, each row displays a unique sequence of size d+1
observed in the sample. The last column, called Nxa, contains the
number of times each of these sequences appeared in the sample.
The number of rows in the output varies between 1 and |A|^{d+1},
where |A| is the number of unique states in X, since it depends
on the number of unique sequences that appear in the sample.
A tibble with all observed sequences of length d+1 and their
absolute frequencies.
countsTab(c(1,2,2,1,2,1,1,2,1,2), 3)
# Using test data.
countsTab(testChains[, 1], 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.