% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CST_ProbBestIndexWeighting.R
\name{CST_ProbBestIndexWeighting}
\alias{CST_ProbBestIndexWeighting}
\title{Computing the weighted tercile probabilities for SFSs of a CSTools
object.}
\usage{
CST_ProbBestIndexWeighting(var_exp, weights_index_exp)
}
\arguments{
\item{var_exp}{An object of the class 's2dv_cube' containing the variable
(e.g. precipitation, temperature, NAO index) array.
The var_exp object is expected to have an element named \code{$data} 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}{An object of the class 's2dv_cube' containing
the normalized weights array.
The weights_index_exp object is expected to have an element named
\code{$data} 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{
CST_ProbBestIndexWeighting() returns a CSTools object (i.e., of the
class 's2dv_cube').
This object has at least an element named \code{$data}
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 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)) and accepts a CSTools object (an object of the class
's2dv_cube') as input.
}
\examples{
var_exp <- 1 : (4 * 2 * 3 * 2 * 3 * 2)
dim(var_exp) <- c(time = 4, dataset = 2, member = 3, season = 2, lat = 3, lon = 2)
weights_index_exp <- runif(4 * 2 * 3 * 2, 0.0001, 0.9999)
dim(weights_index_exp) <- c(time = 4, dataset = 2, member = 3, season = 2)
var_exp <- list(data = var_exp)
weights_index_exp <- list(data = weights_index_exp)
class(var_exp) <- 's2dv_cube'
class(weights_index_exp) <- 's2dv_cube'
res_CST <- CST_ProbBestIndexWeighting(var_exp, weights_index_exp)
dim(res_CST$data)
# time  tercil dataset  season     lat     lon
#    4       3       2       2       3       2
}
\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}
}
