The functions compute (and by default plot) estimates of the Complex Autocovariance, or Complex Autocorrelation, or Partial Complex Autocorrelation functions.
cacf(x, lag.max = NULL, method = c("direct", "conjugate", "pearson",
"kendall", "spearman"), type = c("correlation", "covariance", "partial"),
plot = TRUE, ...)cpacf(x, lag.max = NULL, method = c("direct", "conjugate", "pearson",
"kendall", "spearman"), plot = TRUE, ...)
# S3 method for cacf
print(x, ...)
# S3 method for cacf
plot(x, which = c(1, 2), ask = length(which) > 1,
level = 0.95, ...)
An object of class "cacf", which is a list with the following elements:
lag
A three dimensional array containing the lags at which the cACF is estimated.
acf
An array with the same dimensions as lag containing the estimated cACF.
method
The method used in calculation (same as the method argument).
type
The type of correlation (same as the type argument).
n.used
The number of observations in the time series.
series
The name of the series x.
vector of complex variables.
maximum number of lags. See acf for more details.
method to use in the calculation of the measure. "conjugate"
means that it is based
on the multiplication by conjugate number. "direct"
means the calculation
without the conjugate (i.e. "pseudo" moment). method
can also be "pearson", "kendall", or "spearman", defining what correlation coefficient
to use after the MDS transformation of complex variables x
and y
.
character string giving the type of cACF to be computed. Allowed values are "correlation" (the default) and "covariance". Will be partially matched.
logical. If TRUE
(the default) the cACF is plotted on complex plane
and as two linear graphs for real and imaginary parts.
Parameter for the plot() function.
Determines, which of the plots to produce. 1 is the plot of real and imaginary parts. 2 is the plot of absolute value and the argument.
Determines, whether to ask before producing a new plot or not.
Confidence level for the non-rejection region of the correlation coefficient.
Ivan Svetunkov, ivan@svetunkov.ru
For type="correlation"
and "covariance"
, the estimates are based
on the sample pseudo covariance and use pseudo correlation ccor and complex
covariance ccov respectively. Note that the function does not calculate values for
lag 0. Also, the function will automatically remove NAs. Finally, function does not have
demean
parameter (as, for example, is done in acf), because ccov()
and ccor()
do that automatically.
cpacf()
produces the partial complex ACF based on complex regression model of variable
on its lags.
The generic function plot has a method for objects of class "cacf".
The lag is returned and plotted in units of time, and not numbers of observations.
There is a print and plot methods for objects of class "cacf".
Svetunkov, S. & Svetunkov I. (2022) Complex Autoregressions. In Press.
acf, ccor
# Generate random complex variables
x <- complex(real=rnorm(100,10,10), imaginary=rnorm(100,10,10))
# Calculate cACF
cacf(x)
Run the code above in your browser using DataLab