% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CST_WeightIndex.R
\name{WeightIndex}
\alias{WeightIndex}
\title{Computing the weights for SFSs using the Best Index PDFs.}
\usage{
WeightIndex(index_exp, pdf_exp)
}
\arguments{
\item{index_exp}{Index (e.g. NAO index) array, from a dataset of SFSs
for a period of years, with dimensions (time, dataset, member, season).}

\item{pdf_exp}{Statistics array to define a Gaussian PDF with dimensions
(time, statistic = 2, season) for a period of years.
The firt statistic is the parameter 'mean' of the PDF and
the second statistic is the parameter 'standard deviation' of the PDF.}
}
\value{
WeightIndex() returns a normalized weights array with dimensions
(time, dataset, member, season).
}
\description{
This function implements the computation to obtain the
normalized weights for each member of each SFS or dataset using the
Best Index estimation.
}
\examples{
# Example for the WeightIndex function
index_exp <- 1 : (10 * 3 * 5 * 1)
dim(index_exp) <- c(time = 10, dataset = 3, member = 5, season = 1)
pdf_exp <- 1 : (10 * 2 * 1)
dim(pdf_exp) <- c(time = 10, statistic = 2, season = 1)
res <- WeightIndex(index_exp, pdf_exp)
dim(res)
# time   dataset    member season
#   10         3         5      1
str(res)
# num [1:10, 1:3, 1:5, 1] 0.976 0.958 0.935 0.908 0.881 ...

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