% 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 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{
EMBestIndexWeighting() returns an array 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)).
}
\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, season = 1)
res <- EMBestIndexWeighting(var_exp, weights_index_exp)
dim(res)
# time dataset season
#    2       3      1
# 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(48, min=0.001, max=0.999)
dim(weights_index_exp) <- c(time = 2, dataset = 3, member = 4, season = 2)
res <- EMBestIndexWeighting(var_exp, weights_index_exp)
dim(res)
# time dataset   season  lat     lon
#    2       3        2    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}
}
