countingpatterns | R Documentation |
Calculates the empirical ordinal pattern distribution.
countingpatterns(tsx,h=2,block=FALSE,first=TRUE,tiesmethod=c("random","first"),
generalized=FALSE)
## S3 method for class 'patterncounts'
print(x, ...)
tsx |
numeric vector representing the univariate time series. |
h |
numeric value determining the length of the ordinal pattern; ordinal patterns are of length h+1. |
block |
logical value determining whether patterns are calculated on disjoint blocks or overlapping blocks. |
first |
logical value indicating which observartions are dropped if |
tiesmethod |
character string specifying how ties, that is equal values, are treated if |
generalized |
logical value determining whether classical ordinal patterns or their generalization with regard to ties are considered, see ‘Details’. |
x |
object of class |
... |
further arguments passed to the internal plotting function. |
Ordinal patterns, which are defined as sequences of ranks of h+1
subsequent observations, are a useful tool to describe the dependence within or between time series. That sequences of subseqent observations can either move one observation per time or a whole block of h+1
observations. The former is preferred since it uses more information. If one chooses the later, one has to decide whether the first or the last observations are removed in case that the time series length is no multiple of h+1
. With regard to equal values within a window of consecutive observations (ties), the argument tiesmethod
determines the approach for computing the respective ordinal patterns. The “first
” method is in favor of increasing patterns, whereas the default “random
” puts the equal values in random order.
Beside the classical ordinal patterns, one can also consider the generalized version proposed by Schnurr and Fischer (2022), where the ordinal information of stagnation in the case of ties is also included by taking into account a larger set of patterns.
Object of class "patterncounts"
containing the following values:
patterncounts |
absolute frequencies of ordinal patterns. |
allpatterns |
list of all ordinal patterns considered. |
h |
number of increments defining one pattern; ordinal patterns are of length h+1. |
generalized |
logical value determining whether classical ordinal patterns or their generalization with regard to ties are considered. |
tiesmethod |
character string specifying how ties are treated. |
block |
logical value determining whether patterns are calculated on disjoint blocks or overlapping blocks. |
Angelika Silbernagel
Schnurr, A. (2014): An ordinal pattern approach to detect and to model leverage effects and dependence structures between financial time series, Statistical Papers, vol. 55, 919–931.
Schnurr, A., Dehling, H. (2017): Testing for Structural Breaks via Ordinal Pattern Dependence, Journal of the American Statistical Association, vol. 112, 706–720.
Schnurr, A., Fischer, S. (2022): Generalized ordinal patterns allowing for ties and their application in hydrology, Computational Statistics & Data Analysis, vol 171, 107472.
set.seed(1066)
countingpatterns(rnorm(100))
countingpatterns(rpois(100,1), generalized=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.