GetProbs | R Documentation |

Compute probabilistic forecasts from an ensemble based on the relative thresholds, or the probabilistic observations (i.e., which probabilistic category was observed). A reference period can be specified to calculate the absolute thresholds between each probabilistic category. The absolute thresholds can be computed in cross-validation mode. If data is an ensemble, the probabilities are calculated as the percentage of members that fall into each category. For observations (or forecast without member dimension), 1 means that the event happened, while 0 indicates that the event did not happen. Weighted probabilities can be computed if the weights are provided for each ensemble member and time step.

```
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
)
```

`data` |
A named numerical array of the forecasts or observations with, at least, time dimension. |

`time_dim` |
A character string indicating the name of the time dimension. The default value is 'sdate'. |

`memb_dim` |
A character string indicating the name of the member dimension to compute the probabilities of the forecast, or NULL if there is no member dimension (e.g., for observations, or for forecast with only one ensemble member). The default value is 'member'. |

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

`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. |

`weights` |
A named numerical array of the weights for 'data' with dimensions 'time_dim' and 'memb_dim' (if 'data' has them). 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. |

`cross.val` |
A logical indicating whether to compute the thresholds between probabilistic categories in cross-validation mode. The default value is FALSE. |

`ncores` |
An integer indicating the number of cores to use for parallel computation. The default value is NULL. |

A numerical array of probabilities with dimensions c(bin, the rest dimensions
of 'data' except 'memb_dim'). 'bin' dimension has the length of probabilistic
categories, i.e., `length(prob_thresholds) + 1`

.

```
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)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.