Description Usage Arguments Value Examples
Compute the average or local block entropy of a time series with block size
k
.
1 | block_entropy(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 block entropy. |
Numeric giving the average block entropy or a vector giving the local block entropy.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # The typical usage is to provide the time series and the history length.
xs <- c(0, 0, 1, 1, 1, 1, 0, 0, 0)
block_entropy(xs, k = 1) # 0.9910761
# [ 0.8479969, 0.8479969, 1.169925, 1.169925, 1.169925, 1.169925, 0.8479969,
# 0.8479969, 0.8479969]
block_entropy(xs, k = 1, local = TRUE)
block_entropy(xs, k = 2) # 1.811278
# [ 1.415037, 3.0, 1.415037, 1.415037, 1.415037, 3.0, 1.415037, 1.415037]
block_entropy(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)
block_entropy(xs, k = 2) # 1.936278
# [, 1] 1.415037, 2.415037, 2.415037, 2.415037, 2.415037, 2.0, 1.415037, 1.415037
# [, 2] 2.0 , 1.415037, 2.415037, 2.0, 1.415037, 2.415037, 2.0, 1.415037
block_entropy(xs, k = 2, local = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.