% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CST_EMBestIndexWeighting.R
\name{EMBestIndexWeighting}
\alias{EMBestIndexWeighting}
\title{Computing the weighted ensemble means for SFSs.}
\usage{
EMBestIndexWeighting(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{
EMBestIndexWeighting() returns an array with two or four dimensions
depending if the variable is zonal (as e.g. NAO index)(time, dataset)
or it is spatial variable (as e.g. precipitation or temperature)
(time, dataset, 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)).
}
\examples{
# Example 1 for the EMBestIndexWeighting 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 <- EMBestIndexWeighting(var_exp, weights_index_exp)
dim(res)
# time dataset
#    2       3
str(res)
# num [1:2, 1:3] 36.2 28.8 38.3 31.9 31 ...
# Example 2 for the EMBestIndexWeighting 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 <- EMBestIndexWeighting(var_exp, weights_index_exp)
dim(res)
# time dataset     lat     lon
#    2       3       2       3
str(res)
# num [1:2, 1:3, 1:2, 1:3] 30.7 10.6 30.8 19.7 35.1 ...

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