\name{UltimateBrier}
\alias{UltimateBrier}
\title{
Computes Brier Scores
}
\description{
Interface to compute probabilistic scores (Brier Score, Brier Skill Score) from data obtained from s2dverification.
}
\usage{
UltimateBrier(exp_ano, obs_ano, posdatasets = 1, posmemb = 2, posdates = 3, quantile = TRUE, thr = c(5/100, 95/100), type = 'BS', decomposition = TRUE)
}
\arguments{
  \item{exp_ano}{
Array of experimental data anomalies, as provided by Ano().
  }
  \item{obs_ano}{
Array of observational data anomalies, as provided by Ano().
  }
  \item{posdatasets}{
Expected position of dimension corresponding to the different evaluated datasets in input data (exp_ano and obs_ano).
  }
  \item{posmemb}{
Expected position of dimension corresponding to members in input data (exp_ano and obs_ano).
  }
  \item{posdates}{
Expected position of dimension corresponding to starting dates in input data (exp_ano and obs_ano).
  }
  \item{quantile}{
Flag to stipulate whether a quantile (TRUE) or a threshold (FALSE) is used to estimate the forecast and observed probabilities. Takes TRUE by default.
  }
  \item{thr}{
Value to be used as quantile if 'quantile' is TRUE or as threshold if 'quantile' is FALSE. Takes by default 95 if 'quantile' is TRUE.
  }
  \item{type}{
Type of output desired. Can take the following values:
    \itemize{
      \item{'BS': Simple Brier Score.}
      \item{'FairEnsembleBS': Corrected Brier Score computed across ensemble members.}
      \item{'FairStartDatesBS': Corrected Brier Score computed across starting dates.}
      \item{'BSS': Simple Brier Skill Score.}
      \item{'FairEnsembleBSS': Corrected Brier Skill Score computed across ensemble members.}
      \item{'FairStartDatesBSS': Corrected Brier Skill Score computed across starting dates.}
    }
  }
  \item{decomposition}{
Flag to determine whether the decomposition of the Brier Score into its components should be provided (TRUE) or not (FALSE). Takes TRUE by default. The decomposition will be computed only if 'type' is 'BS' or 'FairStartDatesBS'.
  }
}
\value{
If 'type' is 'FairEnsembleBS', 'BSS', 'FairEnsemblesBSS' or 'FairStartDatesBSS' or 'decomposition' is FALSE and 'type' is 'BS' or 'FairStartDatesBS', the Brier Score or Brier Skill Score will be returned respectively.
If 'decomposition' is TRUE and 'type' is 'BS' or 'FairStartDatesBS' the returned value is a named list with the following entries:
  \itemize{
    \item{'BS': Brier Score.}
    \item{'REL': Reliability component.}
    \item{'UNC': Uncertainty component.}
    \item{'RES': Resolution component.}
  }
}
\examples{
startDates <- c('19901101', '19951101', '20001101')
sampleData <- Load('tos', c('i00k'), c('ERSST'), startDates, nleadtime = 124, 
                   leadtimemin = 1, leadtimemax = 60, output = 'lonlat', 
                   latmin = 30, latmax = 45, lonmin = 0, lonmax = 40)
clim <- Clim(sampleData$mod, sampleData$obs)
ano_exp <- Ano(sampleData$mod, clim$clim_exp)
ano_obs <- Ano(sampleData$obs, clim$clim_obs)
bs <- UltimateBrier(ano_exp, ano_obs)
bss <- UltimateBrier(ano_exp, ano_obs, type = 'BSS')
}
\author{
History:
0.1  -  2015-05 (V. Guemas \email{virginie.guemas@ic3.cat}, C. Prodhomme \email{chloe.prodhomme@ic3.cat}, O. Bellprat \email{omar.bellprat@ic3.cat}, V. Torralba \email{veronica.torralba@ic3.cat}, N. Manubens, \email{nicolau.manubens@ic3.cat})  -  First version
}
\keyword{datagen}
