\name{EnoNew}
\alias{EnoNew}
\title{Computes Effective Sample Size Following Guemas et al, BAMS, 2013b}
\description{
This function computes the equivalent number of independent data in the xdata array following the method described in Guemas V., Auger L., Doblas-Reyes F., JAMC, 2013. The method relies on the Trenberth (1984) formula combined with a reduced uncertainty of the estimated autocorrelation function compared to the original approach.}
\usage{
EnoNew(xdata, detrend = FALSE, filter = FALSE)
}
\arguments{
  \item{xdata}{Timeseries from which the equivalent number of independent data is requested}
  \item{detrend}{TRUE applies a linear detrending to xdata prior to the estimation of the equivalent number of independant data.}
  \item{filter}{TRUE applies a filtering of any frequency peak prior to the estimation of the equivalent number of independant data.}
}
\examples{
# See examples on Load() to understand the first lines in this example
  \dontrun{
configfile <- system.file('config/sample.conf', package = 's2dverification')
file_conn <- file(configfile)
text <- gsub("!!!PATH_TO_REPLACE!!!", system.file('sample_data',
             package = 's2dverification'), readLines(file_conn))
writeLines(text, file_conn)
close(file_conn)
# Now we are ready to use Load().
startDates <- c('19851101', '19901101', '19951101', '20001101', '20051101')
sampleData <- Load('tos', c('experiment'), c('observation'), startDates,
                   leadtimemin = 1, leadtimemax = 4, output = 'lonlat',
                   latmin = 27, latmax = 48, lonmin = -12, lonmax = 40,
                   configfile = configfile)
  }
  \dontshow{
startDates <- c('19851101', '19901101', '19951101', '20001101', '20051101')
sampleData <- s2dverification:::.LoadSampleData('tos', c('experiment'),
                                                c('observation'), startDates,
                                                leadtimemin = 1,
                                                leadtimemax = 4,
                                                output = 'lonlat',
                                                latmin = 27, latmax = 48,
                                                lonmin = -12, lonmax = 40)
  }
eno <- EnoNew(sampleData$mod[1, 1, , 1, 2, 3])
print(eno)
}
\author{
History:\cr
0.1  -  2012-06  (V. Guemas, \email{virginie.guemas@ic3.cat})  -  Original code\cr
1.0  -  2013-09  (N. Manubens, \email{nicolau.manubens@ic3.cat})  -  Formatting to CRAN
}
\keyword{datagen}
