Skip to contents

Reduces the realizations of evaluateDisplacements() to the requested quantiles and mean of the displacement of each model at each yield acceleration. The statistics are marginal: a quantile row of one yield acceleration and the row of the next do not belong to the same realization. Keep the realizations when a later calculation needs paired values.

Usage

summarizeDisplacements(draws, levels)

Arguments

draws

A table with IDn, ky and finite non-negative Dn (cm), one row per realization, as evaluateDisplacements() returns.

levels

Probabilities in (0, 1) and/or the literal "mean", in the order the rows are wanted.

Value

A data.table with IDn, ky (g), level (the probability as text, or "mean"), n (realizations summarized) and Dn (cm), one row per model, yield acceleration and level, the models and yield accelerations in their order of appearance in draws.

Details

The population of each row is the n realizations given for that model and yield acceleration. Realizations of the flexible models of evaluateDisplacements() are conditional on a nonzero displacement (evaluateFlexibleDisplacement()), so their quantiles and mean describe the nonzero displacement and do not include the probability of zero or negligible displacement of the published models.

Mathematics

For the \(N\) realizations \(D_{n,s}\) of one model at one \(k_y\), the quantile of probability \(q\) is type 7 of stats::quantile() (linear interpolation between the order statistics \(\lfloor h \rfloor\) and \(\lceil h \rceil\), \(h = 1 + (N - 1) q\)) and the mean is \(\frac{1}{N}\sum_s D_{n,s}\).

Examples

Draws <- data.frame(IDn = "AM88", ky = 0.1, Dn = c(0.5, 1, 2, 4))
summarizeDisplacements(Draws, levels = c(0.16, 0.5, 0.84, "mean"))
#>       IDn    ky  level     n    Dn
#>    <char> <num> <char> <int> <num>
#> 1:   AM88   0.1   0.16     4 0.740
#> 2:   AM88   0.1    0.5     4 1.500
#> 3:   AM88   0.1   0.84     4 3.040
#> 4:   AM88   0.1   mean     4 1.875