Skip to contents

Pools the realizations of the models named in weights at each yield acceleration and reduces them to weighted quantiles and a weighted mean, the ensemble displacement of those models. Every realization of a model carries the normalized weight of its model. The statistics are marginal over yield acceleration, as in summarizeDisplacements().

Usage

summarizeEnsemble(draws, weights, levels)

Arguments

draws

A table with IDn, ky and finite non-negative Dn (cm), as evaluateDisplacements() returns; rows of models not named in weights are ignored.

weights

Named positive finite weights of the ensemble models; only their ratios matter.

levels

Probabilities in (0, 1) and/or the literal "mean".

Value

A data.table with ky (g), level, n (pooled realizations) and Dn (cm), one row per yield acceleration and level, the yield accelerations in their order of appearance.

Details

The population of each row is the n pooled realizations at that yield acceleration. The pool inherits the conditioning of its members: the realizations of the flexible models of evaluateDisplacements() are conditional on a nonzero displacement (evaluateFlexibleDisplacement()), so the probability of zero or negligible displacement of those published models is not represented in the ensemble quantiles and mean.

Mathematics

With \(\omega_m = w_m / \sum_j w_j\) over the named models, the pooled sample at one \(k_y\) holds \(D_{n,s}^{(m)}\) with weight \(\omega_m\). The weighted mean is \(\sum \omega_m D_{n,s}^{(m)} / \sum \omega_m\) and the weighted quantile of probability \(q\) is the seventh sample quantile definition of Hyndman and Fan (1996), the type 7 of quantile(), extended to cumulative weights: with the distinct sorted values \(x_i\), their summed weights and the total weight \(W\), the order statistics of rank \(\lfloor h \rfloor\) and \(\lfloor h \rfloor + 1\), \(h = 1 + (W - 1) q\), are the smallest \(x_i\) whose cumulative weight reaches each rank, interpolated linearly by the fractional part of \(h\). With equal model weights and \(N\) realizations per model, \(W = N\). Both statistics are computed here without Hmisc and at full precision: equal values are merged exactly, with the estimator of summarizeKmax(). When the pooled sample holds equal values, Hmisc merges values by their 15-significant-digit text, so every pooled value is then read back from that text; the compatibility route of buildDnTables() keeps that text merge, as newmark 1.7.1 did, and this general summary does not (design decision).

References

Hyndman, R. J. and Fan, Y. (1996). Sample quantiles in statistical packages. The American Statistician, 50(4), 361-365. doi:10.1080/00031305.1996.10473566

Examples

Draws <- data.frame(IDn = rep(c("AM88", "BT07"), each = 4), ky = 0.1,
                    Dn = c(0.5, 1, 2, 4, 1, 2, 3, 5))
summarizeEnsemble(Draws, weights = c(AM88 = 1, BT07 = 1), levels = c(0.5, "mean"))
#>       ky  level     n     Dn
#>    <num> <char> <int>  <num>
#> 1:   0.1    0.5     8 2.5000
#> 2:   0.1   mean     8 2.3125