freqTab {hdMTD} | R Documentation |
A tibble containing sample sequence frequencies and estimated probabilities
Description
This function returns a tibble containing the sample sequences, their frequencies and the estimated transition probabilities.
Usage
freqTab(S, j = NULL, A, countsTab, complete = TRUE)
Arguments
S |
A numeric vector of positive integers or |
j |
An integer or |
A |
A vector with nonnegative integers. Must have at least two different entries.
|
countsTab |
A tibble or a data frame with all sequences of length d+1 that
appear in the sample, and their absolute frequency. This tibble is typically
generated by the function |
complete |
Logical. If |
Details
The parameters S
and j
determine which columns of countsTab
are retained in the output. Specifying a lag j
is optional. All lags can
be specified via S
, while leaving j = NULL
(default). The output
remains the same as when specifying S
and j
separately. The
inclusion of j
as a parameter improves clarity within the package's
algorithms. Note that j
cannot be an element of S
.
Value
A tibble where each row represents a sequence of elements from A
.
The initial columns display each sequence symbol separated into columns
corresponding to their time indexes. The remaining columns show the sample
frequencies of the sequences and the MLE (Maximum Likelihood Estimator)
of the transition probabilities.
Examples
freqTab(S=c(1,4),j=2,A=c(1,2,3),countsTab = countsTab(testChains[,2],d=5))
#Equivalent to freqTab(S=c(1,2,4),j=NULL,A=c(1,2,3),countsTab = countsTab(testChains[,2],d=5))