\name{Corr}
\alias{Corr}
\title{
Computes the correlation coefficient between the ensemble mean and observations.
}
\description{

Calculates the correlation coefficient (Pearson, Kendall or Spearman) between the ensemble mean and the observations along the initialization times. The confidence interval and p-value from a one-tailed t-test are provided, where the number of degrees of freedom is calculated using the effective numberof observations (see Eno). \cr


}
\usage{
Corr(ens, obs, posloop = 1, poscor = 2, compROW = NULL, 
     limits = NULL, siglev = 0.95, method = 'pearson', 
     conf = TRUE, pval = TRUE)
}
\arguments{
  \item{ens}{
N by M matrix of N forecasts from M ensemble members.
  }
  \item{obs}{
Vector of the corresponding observations of length N.
  }
 
  \item{siglev}{
Significance level. Default = 0.95.
  }
  \item{method}{
Type of correlation: 'pearson', 'spearman' or 'kendall'. Default='pearson'
  }
  \item{conf}{
Whether to compute confidence intervals (default = 'TRUE') or not (FALSE).
  }
  \item{pval}{
Whether to compute statistical significance p-value (default = 'TRUE') or not (FALSE).
  }
}
\value{
A list containing the following components :\cr
statistic - the value of the test statistic \cr
conf_low - the lower limit of the confidence interval \cr
conf_high - the upper limit of the confidence interval \cr
p.val - the p value 
}
\examples{
obs <- rnorm(100)
ens <- matrix(rnorm(500), c(100,5))
Corr(ens,obs)
}
\author{
History:\cr
0.1  -  2011-04  (V. Guemas, \email{vguemas at ic3.cat})  -  Original code\cr
1.0  -  2013-09  (N. Manubens, \email{nicolau.manubens at ic3.cat})  -  Formatting to R CRAN\cr
1.1  -  2014-10  (M. Menegoz, \email{martin.menegoz at ic3.cat})  -  Adding siglev argument\cr
1.2  -  2015-03  (L.P. Caron, \email{louis-philippe.caron at ic3.cat})  - Adding method argument
}
\keyword{datagen}
