Skip to contents

Evaluates ensemble and per-submodel Dn over a vector of ky values. The scenario is sampled once and the same epsilon is reused across all ky so that each realisation s represents a coherent physical curve Dn_s(ky).

Usage

fitDnCurve(
  uhs,
  ky,
  Ts,
  Mw = 6.5,
  NS = 30L,
  weights,
  NFC = "D100",
  pulse = FALSE
)

Arguments

uhs

A quantile data.table with columns Tn, p, Sa, or an analytic finite-mixture data.table with columns Tn, k, muLn, sigmaLn, and w. OpenQuake fractiles must first be calibrated with fitSaLognormal(); the quantile form is for spectra already represented by quantiles.

ky

numeric vector, yield accelerations (g)

Ts

numeric scalar, fundamental period (s)

Mw

numeric scalar, moment magnitude

NS

integer, Monte Carlo samples for curve quantiles and per-realisation draws.

weights

named numeric vector, ensemble weights by IDn

NFC

character, near-fault component selector for model BM19: "D100" (maximum component, default) or "D50". Ignored by all other submodels.

pulse

logical, near-fault forward-directivity pulse motion declared by the analyst (BM19 only; see ?Dn_BM19). Default FALSE = ordinary-motion equation.

Value

list(curve, draws). curve = data.table(ky, p, Dn, IDn, w). draws = data.table(ky, s, PGA.s, Dn, IDn), where PGA.s is the sampled PGA in g for realization s. Draws are always populated (possibly empty when no model produces output). Dn is in 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))
} # }