diffCirc {sdetorus} | R Documentation |
Lagged differences for circular time series
Description
Returns suitably lagged and iterated circular differences.
Usage
diffCirc(x, circular = TRUE, ...)
Arguments
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 |
Details
If x
is a matrix then the difference operations are carried
out row-wise, on each column separately.
Value
The value of diff(x, ...)
, circularly wrapped. Default
parameters give an object of the kind of x
with one less entry or row.
Examples
# 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)
[Package sdetorus version 0.1.10 Index]