Calculate the residuals of a CSI process.
csi_resid(dX, drift, acf, Sigma)
A residual matrix of the same size as dX
.
The residuals are calculated as
where the "square roots" correspond to the Cholesky decomposition for the row-dependence matrix toeplitz(acf)
, and the eigen decomposition for the column-dependence matrix Sigma
.
# simulate data from the fbm model
alpha <- .8
dt <- 1/60
N <- 1800
ndim <- 2
Xt <- csi_sim(drift = matrix(0, N-1, ndim),
acf = fbm_acf(alpha, dt, N-1),
Sigma = diag(ndim),
X0 = rep(0, ndim))
# compute the residuals
Z <- csi_resid(dX = apply(Xt, 2, diff),
drift = matrix(0, N-1, ndim),
acf = fbm_acf(alpha, dt, N-1),
Sigma = diag(ndim))