% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CST_ProbBestIndexWeighting.R
\name{ProbBestIndexWeighting}
\alias{ProbBestIndexWeighting}
\title{Computing the weighted tercile probabilities for SFSs.}
\usage{
ProbBestIndexWeighting(var_exp, weights_index_exp)
}
\arguments{
\item{var_exp}{Variable (e.g. precipitation, temperature, NAO index)
array from a SFS with three dimensions (time, dataset, member) for a zonal 
variable or dimensions (time, dataset, member, lat, lon) for a spatial 
variable.}

\item{weights_index_exp}{Normalized weights array with dimensions 
(time, dataset, member, season).}
}
\value{
ProbBestIndexWeighting() returns an array with four or six dimensions 
depending if the variable is zonal (as e.g. NAO index)
(time, tercil, dataset, season) or it is spatial variable (as e.g. 
precipitation or temperature) (time, tercil, dataset, season, lat, lon), 
containing the terciles probabilities computing with weighted members.
The first tercil is the lower tercile, the second is the normal tercile and
the third is the upper tercile.
}
\description{
This function implements the computation to obtain the tercile
probabilities for a weighted variable from SFSs through Best estimation of
one index or driver of climate variability (as e.g., the North Atlantic
Oscillation (NAO)).
}
\examples{
# Example 1 for the ProbBestIndexWeighting function
var_exp <- 1 : (2 * 3 * 4)
dim(var_exp) <- c(time = 2, dataset = 3, member = 4)
weights_index_exp<- runif(24, min=0.001, max=0.999)
dim(weights_index_exp) <- c(time = 2, dataset = 3, member = 4, season = 1)
res <- ProbBestIndexWeighting(var_exp, weights_index_exp)
dim(res)
# time tercil dataset season
#    2      3       3      1
# Example 2 for the ProbBestIndexWeighting function
var_exp <- 1 : (2 * 3 * 4 * 2 * 3)
dim(var_exp) <- c(time = 2, dataset = 3, member = 4, lat = 2, lon = 3)
weights_index_exp<- runif(24, min=0.001, max=0.999)
dim(weights_index_exp) <- c(time = 2, dataset = 3, member = 4, season = 1)
res <- ProbBestIndexWeighting(var_exp, weights_index_exp)
dim(res)
# time  tercil dataset   season  lat     lon
#    2       3       3        1    2       3

}
\references{
Regionally improved seasonal forecast of precipitation through Best
estimation of winter NAO, Sanchez-Garcia, E. et al.,
Adv. Sci. Res., 16, 165174, 2019, https://doi.org/10.5194/asr-16-165-2019
}
\author{
Eroteida Sanchez-Garcia - AEMET, \email{esanchezg@aemet.es}
}
