cacf {complex} | R Documentation |
Complex Correlation Function Estimation
Description
The functions compute (and by default plot) estimates of the Complex Autocovariance, or Complex Autocorrelation, or Partial Complex Autocorrelation functions.
Usage
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 class 'cacf'
print(x, ...)
## S3 method for class 'cacf'
plot(x, which = c(1, 2), ask = length(which) > 1,
level = 0.95, ...)
Arguments
x |
vector of complex variables. |
lag.max |
maximum number of lags. See acf for more details. |
method |
method to use in the calculation of the measure. |
type |
character string giving the type of cACF to be computed. Allowed values are "correlation" (the default) and "covariance". Will be partially matched. |
plot |
logical. If |
... |
Parameter for the plot() function. |
which |
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. |
ask |
Determines, whether to ask before producing a new plot or not. |
level |
Confidence level for the non-rejection region of the correlation coefficient. |
Details
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".
Value
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.
Author(s)
Ivan Svetunkov, ivan@svetunkov.ru
References
Svetunkov, S. & Svetunkov I. (2022) Complex Autoregressions. In Press.
See Also
Examples
# Generate random complex variables
x <- complex(real=rnorm(100,10,10), imaginary=rnorm(100,10,10))
# Calculate cACF
cacf(x)