cvar {complex}R Documentation

Correlation, Variance and Covariance (Matrices) for complex variables

Description

Functions cvar(), ccov() and ccor() return respectively complex variance, covariance and correlation based on the provided complex vector/matrix x. Function covar() returns the covariance matrix based on a complex vector/matrix.

Usage

cvar(x, method = c("direct", "conjugate"), df = NULL, ...)

ccov(x, y, method = c("direct", "conjugate"), df = NULL, ...)

ccor(x, y, method = c("direct", "conjugate", "pearson", "kendall",
  "spearman"), ...)

ccov2cor(V)

covar(x, df = NULL)

Arguments

x

vector or matrix of complex variables. If it is matrix then the variable y is ignored.

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). For ccor the variable method can also be "pearson", "kendall", or "spearman", defining what correlation coefficient to use after the MDS transformation of complex variables x and y.

df

Number of degrees of freedom to use in the calculation of the statistics.

...

parameters passed to mean() functions. For example, this can be na.rm=TRUE to remove missing values or trim to define the trimming in the mean (see mean).

y

second vector to calculate covariance or correlations with.

V

complex (pseudo)covariance matrix.

Details

Only the parametric correlation is supported by the function. If x is matrix, then y is ignored.

covar() function returns a covariance matrix calculated for the provided complex vector or matrix x.

Value

A scalar or a matrix with resulting complex variables.

Author(s)

Ivan Svetunkov, ivan@svetunkov.ru

References

See Also

cor

Examples


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

# Create a matrix of complex variables
z <- cbind(x,y)

# Calculate measures
cvar(x)
cvar(z)
ccor(x,y)
ccor(z)


[Package complex version 1.0.0 Index]