% 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 at least two dimensions (time, member).
If the variable is spatial the dimensions would be (time, member, lat, lon).
If we want to compute for several SFSs, the array could have another
dimension (time, dataset, member, lat, lon).}

\item{weights_index_exp}{Normalized weights array with at least two
dimensions (time, member). If we want to compute for several SFSs,
the array could have another dimension (time, dataset, member).}
}
\value{
ProbBestIndexWeighting() returns an array with three or five dimensions
depending if the variable is zonal (as e.g. NAO index)(time, tercil, dataset)
or it is spatial variable (as e.g. precipitation or temperature)
(time, tercil, dataset, lat, lon), containing the terciles probabilities
computing with weighted members.
The firt 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)
res <- ProbBestIndexWeighting(var_exp, weights_index_exp)
dim(res)
# time tercil dataset
#    2      3       3
str(res)
# num [1:2, 1:3, 1:3] 0.6773 0 0 0.0413 1.8419 ...
# 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)
res <- ProbBestIndexWeighting(var_exp, weights_index_exp)
dim(res)
# time  tercil dataset     lat     lon
#    2       3       3       2       3
str(res)
# num [1:2, 1:3, 1:3, 1:2, 1:3] 0.703 0 0 0.236 1.87 ...

}
\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}
}
