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. "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.

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 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.

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:

Author(s)

Ivan Svetunkov, ivan@svetunkov.ru

References

See Also

acf, ccor

Examples


# Generate random complex variables
x <- complex(real=rnorm(100,10,10), imaginary=rnorm(100,10,10))

# Calculate cACF
cacf(x)


[Package complex version 1.0.0 Index]