% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/GetProbs.R
\name{GetProbs}
\alias{GetProbs}
\title{Compute forecast probability}
\usage{
GetProbs(
  data,
  time_dim = "sdate",
  memb_dim = "member",
  indices_for_quantiles = NULL,
  prob_thresholds = c(1/3, 2/3),
  weights = NULL,
  cross.val = FALSE,
  ncores = NULL
)
}
\arguments{
\item{data}{A named numerical array of the forecast or observation with at 
least time dimension.}

\item{time_dim}{A character string indicating the name of the time dimension.
The default value is 'sdate'.}

\item{memb_dim}{A character string indicating the name of the member dimension
to compute the probabilities of the forecast. The default value is 'member'.}

\item{indices_for_quantiles}{A vector of the indices to be taken along 'time_dim' 
for computing the thresholds between the probabilistic categories. If NULL,
the whole period is used. The default value is NULL.}

\item{prob_thresholds}{A numeric vector of the relative thresholds (from 0 to
1) between the categories. The default value is c(1/3, 2/3), which 
corresponds to tercile equiprobable categories.}

\item{weights}{A named numerical array of the weights for 'data' with 
dimensions 'time_dim' and 'memb_dim' (if 'data' has it). The default value is 
NULL. The ensemble should have at least 70 members or span at least 10 time 
steps and have more than 45 members if consistency between the weighted and
unweighted methodologies is desired.}

\item{cross.val}{A logical indicating whether to compute the thresholds between 
probabilistic categories in cross-validation. The default value is FALSE.}

\item{ncores}{An integer indicating the number of cores to use for parallel 
computation. The default value is NULL.}

\item{dat_dim}{A character string indicating the name of dataset dimension. 
The default value is NULL, which means no dataset dimension.}
}
\value{
A numerical array of probabilities with dimensions c(bin, the rest dimensions
of 'data' except 'memb_dim'). 'bin' dimension has the length of categories, 
i.e., \code{length(prob_thresholds) + 1}.
}
\description{
Compute the forecast probability based on the relative thresholds. A certain 
period can be specified to calculate the quantiles between each probabilistic
category. If data has ensemble, all the members are used together to 
calculate the probabilities. Weights of each member and time can be provided.
Cross-validation can be chosen when absolute threshold is calculated.
}
\examples{
data <- array(rnorm(2000), dim = c(ensemble = 25, sdate = 20, time = 4))
res <- GetProbs(data = data, time_dim = 'sdate', memb_dim = 'ensemble', indices_for_quantiles = 4:17)

}
