binary2tau | R Documentation |
Convert changepoint sets to binary strings
binary2tau(x)
tau2binary(tau, n)
x |
A binary string that encodes a changepoint set. See
|
tau |
a numeric vector of changepoint indices |
n |
the length of the original time series |
In order to use GA::ga()
in a genetic algorithm, we need to encoude a
changepoint set as a binary string.
binary2tau()
takes a binary string representation of a changepoint set and
converts it into a set of changepoint indices.
tau2binary()
takes a set of changepoint indices the number of observations
in the time series and converts them into a binary string representation of
that changepoint set.
binary2tau()
: an integer
vector
tau2binary()
: an integer
vector of length n
# Recover changepoint set indices from binary strings
binary2tau(c(0, 0, 1, 0, 1))
binary2tau(round(runif(10)))
# Recover binary strings from changepoint set indices
tau2binary(c(7, 17), n = 24)
tau2binary(binary2tau(c(0, 0, 1, 1, 0, 1)), n = 6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.