diffCirc | R Documentation |
Returns suitably lagged and iterated circular differences.
diffCirc(x, circular = TRUE, ...)
x |
wrapped or unwrapped angles to be differenced. Must be a vector or a matrix, see details. |
circular |
convenience flag to indicate whether wrapping should be
done. If |
... |
parameters to be passed to |
If x
is a matrix then the difference operations are carried
out row-wise, on each column separately.
The value of diff(x, ...)
, circularly wrapped. Default
parameters give an object of the kind of x
with one less entry or row.
# Vectors
x <- c(-pi, -pi/2, pi - 0.1, -pi + 0.2)
diffCirc(x) - diff(x)
# Matrices
set.seed(234567)
N <- 100
x <- t(euler2D(x0 = rbind(c(0, 0)), A = diag(c(1, 1)), sigma = rep(2, 2),
mu = c(pi, pi), N = N, delta = 1, type = 2)[1, , ])
diffCirc(x) - diff(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.