Circular gaps
Computation of the circular gaps of an angular sample Θ1,…,Θn on [0,2π), defined as [REMOVE_ME]Θ(2)−Θ(1),…,Θ(n)−Θ(n−1),2π−Θ(n)−Θ(1),[REMOVEME2]
where [REMOVE_ME]0≤Θ(1)≤Θ(2)≤…≤Θ(n)≤2π.[REMOVEME2]
cir_gaps(Theta, sorted = FALSE)
Arguments
Theta
: a matrix of size c(n, M)
with M
samples of size n
of circular data on [0,2π). Must not contain NA
's.
sorted
: are the columns of Theta
sorted increasingly? If TRUE
, performance is improved. If FALSE
(default), each column of Theta
is sorted internally.
Returns
A matrix of size c(n, M)
containing the n
circular gaps for each of the M
circular samples.
Description
Computation of the circular gaps of an angular sample Θ1,…,Θn on [0,2π), defined as
Θ(2)−Θ(1),…,Θ(n)−Θ(n−1),2π−Θ(n)−Θ(1),
where
0≤Θ(1)≤Θ(2)≤…≤Θ(n)≤2π.
Warning
Be careful on avoiding the next bad usages of cir_gaps
, which will produce spurious results:
- The entries of
Theta
are not in [0,2π).
Theta
is not sorted increasingly when data_sorted = TRUE
.
Examples
Theta <- cbind(c(pi, 0, 3 * pi / 2), c(0, 3 * pi / 2, pi), c(5, 3, 1))
cir_gaps(Theta)