Description Usage Arguments Details Value Examples
This S3 generic function is intended to compute the rank of each observation when pooled with its associated ensemble forecast and return the count in each rank (i.e. the rank histogram).
1 |
fcst |
an object containing the ensemble forecasts. |
obs |
an object containing the observation associated to the forecast in
|
... |
additional arguments. |
For new methods, the output should be an object of class
c("rkhist", "matrix"), with one rank histogram in each row. Rows may
be named.
An S3 object of class rkhist (indeed a matrix containing the
count for each rank, with class "rkhist"). Each row of the matrix
contains the counts for one rank histogram.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | set.seed(42)
N <- 1000
M <- 20
fcst <- matrix(rnorm(N*M), ncol = M)
fcst2 <- matrix(rnorm(N*M), ncol = M)
obs <- rnorm(N)
## Computation of one rank histogram
# Named
rkh <- rkhist(fcst, obs, names = "a")
print(rkh)
plot(rkh)
# Unnamed
rkh2 <- rkhist(fcst2, obs)
print(rkh2)
plot(rkh2)
## Computation of two rank histograms, from a list of forecasts, with the
## same observation vector
fcstsl <- list(fcst, fcst2)
rkhsl <- rkhist(fcstsl, obs, names = c("a", NA))
print(rkhsl)
plot(rkhsl)
## Concatenation of two rank histograms, with different names
rkhs <- rbind_rkhists(rkh, rkh2, names = letters[3:4])
rownames(rkhs)
print(rkhs)
plot(rkhs)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.