Skip to contents

Each model's Dn(ky) curve is inverted once for every realisation s. The model root distributions are pooled with their epistemic weights, matching the weighted draw aggregation used for displacement curves.

Usage

invertDnDraws(draws, Da, weights, p = c(0.05, 0.1, 0.16, 0.5, 0.84, 0.9, 0.95))

Arguments

draws

data.table(ky, s, Dn, IDn) with Dn in cm. Draws produced by fitDnCurve() also contain PGA.s, the sampled PGA in g. PGA.s is required to recover exact AM88 roots when the stored ky support is flat.

Da

numeric vector - displacement targets in cm

weights

named numeric vector, ensemble weights by IDn

p

numeric quantiles in (0,1) to report alongside the mean. Default c(0.05, 0.10, 0.16, 0.50, 0.84, 0.90, 0.95). The output always includes the ensemble mean as the first p row.

Value

data.table(Da, p, kmax, beyond). Column p is character: "mean" or the numeric quantile formatted as "0.84", "0.90", etc. beyond is the pooled weighted share of realisations whose root lies outside the stored ky grid, constant across the p rows of one Da.

Details

Boundary policy (uniform over models and realisations): displacements below the one-micron physical floor are censored to zero before any log-space operation. A target Da above a realisation's physical ceiling is met by any coefficient, so that realisation saturates at kmax = 0 (null demand) and stays in the pool; downstream log-scale consumers must filter kmax > 0 and truncate the curve at its support edge. A crossing that falls between the last positive envelope point and the floored tail resolves to the first floored ky (grid resolution). The strong-demand end (target below the entire curve, no floored tail) inverts the model's own closed equation beyond the stored grid: quadratic in ln ky for BT07/BM17/BM19, the exact r = ky/PGA.s shape for AM88/JB07/SR08 with the rigid-block domain ending at r = 0.9999. A flat positive AM88 curve at the producer limit keeps its exact sub-grid inverse. Every root resolved outside the stored grid is reported with beyond = TRUE, and the aggregate carries the pooled weighted share of such roots.

All inputs must be in the same displacement units (cm).

Examples

if (FALSE) { # \dontrun{
uhs <- data.table::fread(
  system.file("extdata", "uhs.csv", package = "newmark"))
out <- fitDnCurve(uhs, ky = getDnKy(uhs, Ts = 0.3), Ts = 0.3, Mw = 7.5,
                  NS = 100,
                  weights = c(AM88=1, BT07=1, SR08=1, BM17=1))
invertDnDraws(out$draws, Da = c(2.5, 5, 10),
              weights = c(AM88=1, BT07=1, SR08=1, BM17=1))
} # }