\name{MCA}
\alias{MCA}
\title{
Maximum Covariance Analysis
}
\description{
Computes a Maximum Covariance Analysis (MCA) between vary and varx, both
of dimensions c(n. of time steps, n. of latitudes, n. of longitudes). 
Returns a vector of squared covariance fraction (SCFs) explained by 
each pair of covariability modes, a vector of correlation coefficient 
(RUVs) between expansion coefficients (ECs) that measures their linear 
relationship, and a set of regression (MCAs) associated with the 
covariability modesi (ECs). Note that MCAs are 'homogeneous' patterns obtained 
as regression/correlation between each field (predictor, predictand) 
and its expansion coefficient.
The threshold for the correlation coefficient, based on a two-tailed 
Student's t-test, is also produced.
}
\usage{
MCA(vary, varx, siglev = 0.98)
}
\arguments{
  \item{vary}{
Array containing the anomalies field for the predictor. The expected
dimensions are c(n. of time steps, n. of latitudes, n. of longitudes).
  }
  \item{varx}{
Array containing the anomalies field for the predictand. The expected
dimensions are c(n. of time steps, n. of latitudes, n. of longitudes).
  }
  \item{siglev}{
Value of the confidence level for the correlation map. It is based on a 
two-tailed Student's t-test. Default is \code{siglev = 0.98} (98% confidence 
level; 2% significance level).
  }
}
\value{
  \item{$SCFs}{
Vector of squared covariance fractions (n. of modes).
  }
  \item{$RUVs}{
Vector of correlations between expansion coefficients (n. of modes).
  }
  \item{$ECs_U}{
Array of expansion coefficients of predictor field (n. of time steps, n. of modes).
  }
  \item{$MCAs_U}{
Array of covariability patterns of predictor field (c(dim), n. of modes).
  }
  \item{$ECs_V}{
Array of expansion coefficients of predictand field (n. of time steps, n. of modes).
  }
  \item{$MCAs_V}{
Array of covariability patterns of predictand field (c(dim), n. of modes).
  }
  \item{$Rtest}{
Value of the statitically significant corr. coefficient at \code{siglev}.
  }
}
\examples{
}
\author{
History:\cr
0.1  -  2010-09  (J.-G. Serrano, \email{javier.garcia at bsc.es})  -  Original code\cr
1.0  -  2016-04  (N. Manubens, \email{nicolau.manubens at bsc.es})  -  Formatting to R CRAN
}
\keyword{datagen}
