Invert Dn draws to kmax(Da)
invertDnDraws.RdEach 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 byfitDnCurve()also containPGA.s, the sampled PGA in g.PGA.sis 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). Column p is character: "mean" or the
numeric quantile formatted as "0.84", "0.90", etc.
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). Only the strong-demand
end (target below the entire curve, no floored tail) keeps log-log linear
extrapolation beyond the largest stored ky. A flat positive AM88 curve at
the producer limit keeps its exact sub-grid inverse.
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))
} # }