View source: R/dcor_serial_test.R
| dacf_curve | R Documentation |
Computes lagwise distance covariance or distance correlation values for a
univariate or multivariate time series and returns an object that can be
plotted as a dependogram using plot().
dacf_curve(
x,
transform = c("none", "bowl", "biloop"),
measure = c("dcov", "dcor"),
lags = NULL,
block_size = NULL,
...
)
x |
A numeric vector or numeric matrix containing a time series. If
|
transform |
Character string indicating whether the data should be
transformed before computing the lagwise dependence measure. One of
|
measure |
Character string specifying the lagwise dependence measure.
Either |
lags |
Integer vector of lags to compute. If |
block_size |
Either |
... |
Additional arguments passed to |
The function computes either \mathrm{dCov}(X_t, X_{t+k}) or
\mathrm{dCor}(X_t, X_{t+k}) for each lag k. The choice is
controlled by measure.
If block_size = NULL, the standard full pairwise-distance computation
is used at each lag. If block_size is positive, a blockwise
computation is used. The block size does not need to divide n - k;
the final block may be smaller.
If transform = "bowl" or transform = "biloop", the
transformation is applied before computing the lagwise distance
autocorrelations. For multivariate input, "biloop" is allowed but is
generally not recommended.
The returned object is compatible with plot.sdt(), so the lagwise values
can be shown as a barplot or line plot in the same style as the dependograms
produced by dcor_serial_test() and hsic_serial_test().
An object of class "sdt" containing the lagwise dependence values in
estimate. It can be plotted with plot().
x <- as.numeric(arima.sim(list(ar = 0.6), n = 200))
fit <- dacf_curve(x, lags = 1:10)
plot(fit)
y <- as.numeric(arima.sim(list(ar = 0.6), n = 200))
fit2 <- dacf_curve(y, lags = 1:10, block_size = 64L)
plot(fit2, type = "line")
# Multivariate example
set.seed(1)
X <- cbind(
as.numeric(arima.sim(list(ar = 0.5), n = 200)),
as.numeric(arima.sim(list(ar = -0.3), n = 200))
)
fit3 <- dacf_curve(X, lags = 1:8)
plot(fit3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.