% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CST_EMBestIndexWeighting.R
\name{CST_EMBestIndexWeighting}
\alias{CST_EMBestIndexWeighting}
\title{Computing the weighted ensemble means for SFSs of a CSTools object.}
\usage{
CST_EMBestIndexWeighting(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_EMBestIndexWeighting() returns a CSTools object (i.e., of the
class 's2dv_cube').
This object has at least an element named \code{$data}
with three or five dimensions depending if the variable is zonal
(as e.g. NAO index)(time, dataset, season) or it is spatial variable
(as e.g. precipitation or temperature) (time, dataset, season, lat, lon),
containing the ensemble means computing with weighted members.
}
\description{
This function implements the computation to obtain the weighted
ensemble means for 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_EMBestIndexWeighting(var_exp, weights_index_exp)
dim(res_CST$data)
# time dataset  season     lat     lon
#    4       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}
}
