% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CST_PDFIndexFcst.R
\name{PDFIndexFcst}
\alias{PDFIndexFcst}
\title{Computing the Index PDFs for a dataset of SFSs for a forecast year.}
\usage{
PDFIndexFcst(index_hind, index_obs, index_fcst, type_exp = "ens",
  method = "ME", na.rm = FALSE)
}
\arguments{
\item{index_hind}{Index (e.g. NAO index) array from SFSs with dimensions
(time, dataset, member, season) or 
(time, dataset, member=1, statistic=2, season) for a hindcast period.
The dimensions 'time' must be greater than 2. When dimension 'statistic' 
doesn't exist, the dimension member' must be greater than 1.}

\item{index_obs}{Index (e.g. NAO index) array from an observational database
or reanalysis with dimension (time, dataset, member = 1, season). 
The dimensions 'time' must be greater than 2.}

\item{index_fcst}{Index (e.g. NAO index) array from SFSs.
with dimensions (time = 1, dataset, member) for a forecast year.}

\item{type_exp}{A character string ('ens' or 'sta') to identify if the 
experiment output is an ensemble members or statistics.}

\item{method}{A character string indicating which methodology is applied
to compute the PDF. One of "ME" (default) or "LMEV".}

\item{na.rm}{Logical (default = FALSE). Should missing values be removed?}
}
\value{
PDFIndexFcst() returns an array with dimensions 
(time = 1, dataset, member, season) or 
(time = 1, dataset, member = 1, statistic = 2, season) for the forecast year.
When dimension statistic' doesn't exist, the dimension 'member' must be 
greater than 1.
The firt statistic is the parameter 'mean' of the PDF with not bias corrected
The second statistic is the parameter 'standard deviation' of the PDF
with not bias corrected
The third statistic is the parameter 'mean' of the PDF with bias corrected
The fourth statistic is the parameter 'standard deviation' of the PDF
with bias corrected
}
\description{
This function implements the computation to obtain the index PDFs
(e.g. NAO index) to improve the index estimate from a dataset of SFSs
}
\examples{
# Example for the PDFIndexFcst function
index_fcst <- 1 : (3 * 4)
dim(index_fcst) <- c(time = 1, dataset = 3, member = 4, season = 1)
index_obs<- 1 : (5 * 3)
dim(index_obs) <- c(time = 5, dataset = 3, member = 1, season = 1)
index_hind <- 1 : (5 * 3 * 4)
dim(index_hind) <- c(time = 5, dataset = 3, member = 4, season = 1)
res <- PDFIndexFcst(index_hind, index_obs, index_fcst)
dim(res)
# time statistic   dataset season 
#   1         4         3      1
str(res)
# num [1, 1:4, 1:3, 1] 5.5 22.5 -17 0 6.5 22.5 -16 0 7.5 22.5 ...

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