Description Usage Arguments Value Examples
Compute the average or local entropy rate of a time series with history
length k
.
1 | entropy_rate(series, k, local = FALSE)
|
series |
Vector or matrix specifying one or more time series. |
k |
Integer giving the history length. |
local |
Boolean specifying whether to compute the local entropy rate. |
Numeric giving the average entropy rate or a vector giving the local entropy rate.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # The typical usage is to provide the time series and the history length.
xs <- c(0, 0, 1, 1, 1, 1, 0, 0, 0)
entropy_rate(xs, k = 2) #0.6792696
# [1] 1.0, 0.0, 0.5849625, 0.5849625, 1.5849625, 0.0, 1.0
entropy_rate(xs, k = 2, local = TRUE)
# Multiple Initial Conditions
xs <- matrix(0, nrow = 9, ncol = 2)
xs[, 1] <- c(0, 0, 1, 1, 1, 1, 0, 0, 0)
xs[, 2] <- c(1, 0, 0, 1, 0, 0, 1, 0, 0)
entropy_rate(xs, k = 2) # 0.6253491
# [, 1] 0.4150375, 1.5849625, 0.5849625, 0.5849625, 1.5849625, 0.0, 2.0
# [, 2] 0.0, 0.4150375, 0.5849625, 0.0, 0.4150375, 0.5849625, 0.0
entropy_rate(xs, k = 2, local = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.