\name{Spread}
\alias{Spread}
\title{
  Computes InterQuartile Range, Maximum-Minimum, Standard Deviation and Median
  Absolute Deviation of the Ensemble Members
}
\description{
  Computes the InterQuartile Range, the Maximum minus Mininum, the Standard 
  Deviation and the Median Absolute Deviation along the list of dimensions
  provided by the posdim argument (typically along the ensemble member 
  and start date dimension).
  The confidence interval is computed by bootstrapping.
}
\usage{
  Spread(var, posdim = 2, narm = T)
}
\arguments{
  \item{var}{
    Matrix of any number of dimensions up to 10.
  }
  \item{posdim}{
    List of dimensions along which to compute IQR/MaxMin/SD/MAD.
  }
  \item{narm}{
    T/F if NA removed/kept for computation. Default = T.
  }
}
\details{
  Example:
  --------
  To compute IQR, Max-Min, SD & MAD accross the members and start dates of var 
  output from \code{Load()} or \code{Ano()} or \code{Ano_CrossValid()}, call:
    spread(var, posdim = c(2, 3), narm = T)
}
\value{
  Matrix with the same dimensions as var except along the first posdim
  dimension which is replaced by a length 3 dimension, corresponding to the 
  lower limit of the 95\% confidence interval, the spread and the upper limit 
  of the 95\% confidence interval for each experiment/leadtime/latitude/longitude.
  \item{$iqr}{
    InterQuartile Range.
  }
  \item{$maxmin}{
    Maximum - Minimum.
  }
  \item{$sd}{
    Standard Deviation.
  }
  \item{$mad}{
    Median Absolute Deviation.
  }
}
\author{
  History:
  0.1  -  2011-03  (V. Guemas, \email{virginie.guemas@ic3.cat})  -  Original code
  1.0  -  2013-09  (N. Manubens, \email{nicolau.manubens@ic3.cat})  -  Formatting to CRAN
}
\keyword{datagen}
