Changelog
newmark 1.6.0
Breaking changes
- The JB07 kill-switch is removed (owner ruling 2026-08-07): family aggregates (
ensemble,rigid,flexible) now honor exactly the declared weights.JB07 = 1includes Jibson (2007) in its families;JB07 = 0excludes it, like every other model. Projects that declareJB07 = 0(all current production data.R) are unaffected.
newmark 1.5.0
Breaking changes
-
invertDnDraws(),fitKmaxScenario()andfitKmaxScenarios()add abeyondcolumn: the pooled weighted share of realisations whose root was resolved outside the stored ky grid. Consumers asserting exact schemas must admit the new column.
Bug fixes
- The strong-demand end of the Dn(ky) inversion (target below the entire drawn curve) now inverts each model’s own closed equation instead of extrapolating log-log linearly through the last two grid points: an exact quadratic in
ln kyfor BT07/BM17/BM19, and the exactr = ky/PGA.sshape for AM88/JB07/SR08 with the rigid-block domain ending atr = 0.9999(SR08 recovers its amplitude-dependent epsilon first; JB07 remains an exact unbounded power law). Linear extrapolation over SR08’s structural plateau had produced e17-class roots from high sampled demands, dominating published means.
New features
-
sampleSaCorr(),fitDnCurve(), and thefitDnScenario()row contract acceptzTrunc: symmetric renormalized truncation of each Gaussian-copula marginal at±zTrunc, mirroring the hazard calculation’struncation_level, with recentering to the truncated mixture mean. Analytic mixture input only; quantile input is bounded by its own endpoints and rejects the argument.
newmark 1.4.1
Breaking changes
The analytic identifiers
mu_Lnandsigma_Lnare renamedmuLnandsigmaLneverywhere (function returns, mixture component columns, parameters, and documentation). The underscore spelling violated the project naming contract; no alias is kept.The Dn-to-kmax inversion adopts a declared uniform boundary policy: displacements below the one-micron physical floor are censored to zero, a target above a realisation’s physical ceiling saturates at
kmax = 0(null demand, realisation kept in the pool) instead of log-linear tail extrapolation through underflow, and a crossing into the floored tail resolves to the first floored ky. Flat all-zero curves no longer abort the inversion; the exact flat-AM88 producer-limit inverse is preserved. Log-scale consumers must filterkmax > 0.Scenario runners surface worker errors directly: a failed
mclapplyworker now stops with the original diagnostic instead of a downstreamrbindlisttype error.
newmark 1.4.0
Breaking changes
fitSaLognormal()replaces OpenQuake quantile families with a period-wise analytic lognormal representation. It preserves every reported mean and fitssigma_Ln(Tn)independently at each period with a mean-anchored Huber loss.fitSaFMixture()now consumes and returns analytic components namedmu_Lnandsigma_Ln. It no longer materializes report quantiles; the returned finite mixture is the canonical input for downstream composition and sampling.sampleSaCorr(),getDnKy(), and the existingfitDn*()scenario APIs now consume those analytic mixtures directly. Correlated sampling inverts each mixture CDF at the Gaussian-copula probabilities and preserves its exact mean without reconstructing report fractiles or a quantile spline.Quantile-table inputs remain a distinct contract for spectra whose distribution is already represented by quantiles, including the current MCE envelope workflow. They are not an alternate OpenQuake calibration path: OpenQuake fractiles are consumed by
fitSaLognormal()and discarded.
newmark 1.3.9
Numerical changes
- Dn realization tables now retain the sampled PGA as
PGA.s. When an AM88 realization is flat because its sampled PGA lies below the stored ky grid, kmax recovers the unique root on the physical branch0 < ky / PGA.s < 0.9999. Other curves retain the existing tabular inversion, and flat curves from other models still fail explicitly.
newmark 1.3.8
Behaviour changes
The public kmax APIs now expose one estimator only: epistemically weighted aggregation of the per-model root distributions. The transitional
aggregationMethodselector and the historical root-averaging implementation were removed. The legacy implementation remains reproducible from commit8538e78.fitSaF()now declares the scalar defaultintegrationMethod = "monte-carlo"and validates the accepted choices separately. Omitted calls retain the same Monte Carlo behaviour without depending on the order of a default vector.
newmark 1.3.7
Behaviour changes
- The three public kmax APIs now declare the scalar default
aggregationMethod = "model-mixture". Omitting the argument therefore uses the approved epistemic mixture. The historical"root-mean"estimator remains available only by explicit selection for legacy reproduction. Accepted values are validated separately from the default and no longer depend on the order of a default vector.
newmark 1.3.6
New features
-
invertDnDraws(),fitKmaxScenario()andfitKmaxScenarios()addaggregationMethod. The compatible default,"root-mean", preserves the historical estimator that averages model roots within each shared realisation."model-mixture"instead treats the model root distributions as epistemic branches and applies the same weighted-draw aggregation used for displacement curves.
Performance
- The kmax scenario path now inverts each
(IDn, s)displacement curve once and reuses that ephemeral root population for individual models and all aggregate families. It no longer repeats the numerical inversion for each family.
Numerical changes
- Quantile-mode
fitSaF(integrationMethod = "quadrature")now integrates the two Gaussian-copula variables after their exact transformation to uniform probability space, using tensor Gauss–Legendre quadrature. This preserves the reconstructed marginals, copula, mean recentring, site-response model and tail policy while avoiding the oscillatory Gauss–Hermite convergence observed for steep upper quantile segments. The Monte Carlo path andfitSaFMixture()Gauss–Hermite integration are unchanged.
newmark 1.3.5
Behaviour changes
- The standard
kmaxinversion family now includes the median (p = 0.50) together with0.05,0.10,0.16,0.84,0.90,0.95andmean. BothinvertDnDraws()and the faster scenario path use the same family. The inversion still operates on every simulatedDn(ky)curve before summarising; no quantile is copied from a pre-summarised displacement table.
newmark 1.3.4
New features
-
fitSaF()adds an opt-inintegrationMethod = "quadrature"backend for quantile-defined probabilistic spectra. It integrates the PGA–Sa Gaussian copula by tensor Gauss–Hermite quadrature and the conditional site-response residual analytically, so repeated calls are independent of the random number state. Before mean re-centering, the quantile interpolant passes through the supplied knots and retains their Hyman interpolation; unobserved tails use explicit non-decreasing linear continuation instead of the folded cubic extrapolation possible inbuildQSpline(). Marginals are then re-centered to the published means.integrationMethod = "monte-carlo"remains the default and is unchanged draw-for-draw.
newmark 1.3.3
New features
-
getDesignParameters()returns the ASCE 7-22 Sec. 21.4 design acceleration parametersSDS,SD1,SMSandSM1from the ordinates of a site-specific spectrum.designUHS()already performed this derivation internally without exposing it, so consumers that needed the parameters had to recover them from the shape of its output — which stopped being possible once producers began publishing ordinate-level spectra with no plateau to read them from. The derivation now has one entry point anddesignUHS()calls it.
Behaviour changes
-
designUHS()output is unchanged, verified identical across five input spectra, both levels and fourvs30settings including the error paths. Its cleaning and Sec. 21.4 error messages now namegetDesignParameters()instead, since that is where the check lives.
newmark 1.3.2
New features
-
solveRTGM()implements the risk-targeted ground motion of ASCE 7-22 Sec. 21.2.1: it solves for the spectral ordinate whose lognormal collapse fragility, convolved with the site hazard curve, reaches the target collapse probability. Defaults are the ASCE 7 target set (10 percent conditional collapse at the ordinate, logarithmic standard deviation 0.60, 1 percent in 50 years); every tunable is an argument so that other target sets, such as the AASHTO guide specification, can be selected. Returns the ordinate, the uniform-hazard ordinate and their ratio, the risk coefficient.The procedure follows the USGS Risk-Targeted Ground Motion Calculator (Makdisi 2024, doi:10.5066/P9A2F2B8), which ASCE 7-22 Commentary C21.2.1 traces to Luco et al. (2007). It reproduces that implementation to 1.8e-15 relative across all 340 published NEHRP-2020 fixtures; 60 of them ship as the regression oracle in
tests/testthat/.The hazard curve is resampled and log-log extrapolated to
[0.10, 10]times the 2475-year uniform-hazard ordinate before integrating. Restricting the integral to the tabulated curve domain instead is what makes low-hazard, long-period curves fail to bracket.This is the probabilistic branch only. The Sec. 21.2.2 deterministic motions, the Sec. 21.2.3 80-percent floor and the Sec. 21.2 maximum-direction scaling remain out of scope, as they already are for
designUHS(). The two functions are complementary, not chained:designUHS()consumes a uniform-hazard spectrum and performs the Sec. 21.4 parameterisation, whilesolveRTGM()consumes a hazard curve and returns an ordinate that Sec. 21.3 scales by two thirds directly.
newmark 1.3.1
Fixes
-
sampleSaCorr()and its internal full-correlation path now select every marginal from the requestedTn[j], independent of input row order. The previousdata.tableexpression resolved both uses ofTnas the table column, so columnjused the period stored in input rowj; ordinary period-grouped tables could consequently sample every channel from the PGA marginal. The Gaussian copula and random-number stream are unchanged. PGA-only displacement models are unchanged, while flexible models that useSa(1.3Ts)orSa(1.5Ts)change when the affected input ordering was used.
newmark 1.3.0
CRAN release: 2026-07-16
Model corrections (audit-driven; change numerical results)
-
designUHS()now derives the spectral parameters per ASCE 7-22 Sec. 21.4 (site-specific input): at MCER level,SMS = 0.9 * max SaM(T)overTin [0.2, 5] s andSM1 = max(0.9 * max[T * SaM(T)], SaM(1 s))over [1, 2] s whenvs30 > 442m/s, else [1, 5] s (new optionalvs30argument;NULLuses the conservative wide window). The previous seeding (Ss = Sa(0.2 s),S1 = Sa(1.0 s),Fa = Fv = 1) matched no ASCE 7-22 pathway for site-specific spectra. ASCE-table products shift on the order of 10 percent. The Sec. 21.2.3 floor and the Sec. 21.2.2 deterministic cap remain out of scope (documented).
Fixes
-
designUHS(): the output grid beyondTLwas degenerate wheneverTL >= 5(including the default 8 s), so the long-period branch (ASCE 7-22 Eq. 11.4-5) never appeared in the returned table; the grid now samples one octave beyondTL. Documentation now states precisely which parts of ASCE 7-22 the function implements (the Sec. 21.4 derivation and Sec. 11.4.5.2 two-period shape) and which it does not (the Sec. 21.2 floor and deterministic cap).
Breaking changes
- The dead
Rrupargument has been REMOVED fromrhoBJ(),fitSaF(),fitDnCurve(), andfitDnModel(), and from thefitDnScenario()records contract (a legacyRrupcolumn inrecordsis tolerated and ignored). The Baker & Jayaram (2008) inter-period correlation model has no distance dependence, so the argument never influenced any result: outputs are identical draw-for-draw under the same seed. Callers passingRrupby position or by name must drop it.
newmark 1.2.1
Model corrections (audit-driven; change numerical results)
Dn_BT07(): restored the published+ 1.50 * Tsterm of Bray & Travasarou (2007) Eq. 5, previously missing (the function receivedTsbut never used it), and the-0.22intercept for nearly rigid sliding masses (Ts < 0.05s). The implementation now reproduces the worked example published by Bray (2007). Median displacements increase byexp(1.5 * Ts)(about x2.1 atTs = 0.5s).geSiteTable()/getSiteProperties(): the Shibata-Soelarno (1975) row of the Ishihara (1996) shear-modulus table now uses its published LINEAR void-ratio formF(e) = Ce - e/(1 + e); the quadratic form of the other models had been applied to it, under-predicting that model by a factor of about 65 and dragging the Sands-group mean modulus down (about -20 percent inGofor typical sand profiles).fitModel.Ts(): rebuilt on the classical Rayleigh quotient with the static-deflection trial shape. The previous trial shape violated the base boundary condition under package usage and overestimated the fundamental period of normal (stiffness-increasing) profiles by tens of percent (e.g. +44 percent on a 200/400 m/s two-layer column, +27 percent on the vignette profile). The rebuilt estimator is within -0.4 to -2.8 percent of the exact layered solution across test profiles and is invariant to the layer ordering of the input. All Ts-dependent products (site properties, flexible-block displacements) shift on regeneration.Vs30toSID(): the class-B lower bound is now 910 m/s (3000 ft/s, ASCE 7-22 Table 20.2-1), matching the packagedSiteClasstable; it was 900. The class-E row inSiteClassnow prints the correct inequality (<150m/s).
Behaviour changes
-
Dn_BM19()(andfitDnCurve(),fitDnModel()): near-fault pulse behaviour is now selected with the explicitpulseargument (defaultFALSE= ordinary motion), matching the papers’ definition of pulse as a declared property of the record and the authors’ spreadsheet. The automaticPGV > 115cm/s switch is retired; PGV remains a required predictor inside the pulse equations, whose published 150 cm/s sub-regime is unchanged.
newmark 1.2.0
New functions
F_ST20()implements the final 2020 NGA-East ergodic site-amplification generation (Stewart et al. 2020 linear model and F760 impedance/gradient weighting; Hashash et al. 2020 nonlinear model with period-dependent reference velocity and PGA-dependent nonlinear sigma). Coefficients are regenerated from the USGS nshmp-lib machine-readable table (data-raw/SiteAmp2020.R); the implementation is validated at machine precision against the OpenQuakenga_east.pyreference functions.fitSaFMixture()computes site-amplified spectra from an analytic scenario mixture (one lognormal component per rupture-variant x GMPE branch, as produced by the DSHA scenario engine). The composition of the rock mixture with the lognormal site dispersion is exact: Gauss-Hermite quadrature over the PGA channel plus monotone mixture-CDF inversion. No random numbers are drawn - outputs are byte-stable;SaandSaFare quantiles of the same conditional demand distribution andAF = SaF / Sais the amplification of the p-quantile.
Behaviour changes
fitSaF()gains a workingmodelsmenu:"ST20"(new default) and"ST17". Passmodels = "ST17"to reproduce the 2017-generation amplification.F_ST17()sigma corrected: the nonlinear component now applies the PGA-dependent multiplier of its source model (sigma_Fnl = sigma_f2 * ln((PGA_3000 + f3)/f3), PEER 2017/05 Eq. 2.5 as implemented by USGS nshmp-lib and OpenQuake). Earlier versions used baresigma_f2, overstating dispersion at low PGA and understating it at high PGA.muLnFis unchanged;sdLnFnow varies with PGA.
Documentation
- Corrected provenance: the
F_ST17()family implements the PEER Report 2017/05 NGA-East recommendations (not Seyhan & Stewart 2014 as previously documented). The inter-period correlation model is Baker & Jayaram (2008); it has no distance dependence and theRruparguments are retained for backward compatibility only.
newmark 1.1.1
New functions
fitDnScenario()fits the Newmark displacement curve and Monte Carlo draws for a single scenario row (one(TR, IDg)combination). Returns a list withcurveanddrawsdata.tables matching the contract offitDnCurve().fitDnScenarios()appliesfitDnScenario()over arecordsdata.table of scenario rows and row-binds the results. AcceptsuseParallelandworkersarguments for fork-based parallel execution on multi-core systems.fitKmaxScenario()fits the seismic coefficient kmax for a single scenario row given pre-computed displacement draws and model weights. Returns a data.table withDa,p,kmax,PGA,Kh,TR,IDg, andIDn.fitKmaxScenarios()appliesfitKmaxScenario()over arecordsdata.table and row-binds the results. Supports the sameuseParallel/workersinterface asfitDnScenarios().
Performance
-
fitDnScenarios()now runs Dn scenario rows in parallel whenuseParallel = TRUEandworkers > 1L. On systems where fork-based parallelism is available (Linux, macOS), wall time scales nearly linearly withworkersfor large scenario grids. Sequential execution (the default) is unchanged.
Internal tooling
-
inst/cran-release.Rsimplified to a two-phasesource()from the garage canonical scripts (cran-check.Rthencran-submit.R). The prior inline copy of those steps is removed; the garage copy is the single source of truth.
newmark 1.1.0
CRAN release: 2026-05-19
Bug fixes
-
inst/CITATION: replaceutils::packageVersion("newmark")withmeta$Versionso the citation file evaluates correctly when the package is not yet installed (CRAN pre-test failure). -
inst/WORDLIST: add 135 domain-specific terms (author surnames, technical vocabulary, package-internal identifiers) sospelling::spell_check_package()exits clean. AddLanguage: en-USto DESCRIPTION.
Documentation
Vignettes rebuilt for fidelity to the implemented code and the underlying paper (Verri Kozlowski 2026, working). Hallucinated cross-references to deleted articles,
oqt-pipeline terminology leaking intonewmarkprose, and inconsistent function-name references were removed.New vignette
dynamic-site-responsedocuments the dsra-side methodology merged intonewmark1.1.0: Ishihara (1996) small-strain shear-modulus model, Gazetas & Dakoulas (1985) inhomogeneous truncated shear-beam fundamental period, synthetic-profile generation viagetSiteProperties()/geSiteTable(), and the ASCE 7-22 site-class utilitiesVs30toSID()/SIDtoVs30().pipelinevignette rewritten as a function-level overview of the four library workflows (dynamic site response, hazard import, displacement curves, seismic coefficient), with a single top-of-file note that orchestration on a hazard grid (looping scenarios, persisting tables) is the consumer’s responsibility.ensemble-formulationvignette now states the inverse-problem formulation explicitly, documents the BM19 near-fault PGV > 115 cm s⁻¹ correction and theNFCD100/D50 selector, and lists the operational defaults (Monte Carlo size, k_y grid, reported quantiles) that the package and downstream consumers share.newmark-quickstartvignette: stale links to deleted articles removed;Next stepsrewritten as in-packagevignette()and?fnnamereferences.
Improvements (no behavioural change)
-
interpolateSaTable()andbuildQSpline()now emit a descriptivewarning()when called on a UHS table with duplicate(Tn, p)rows, pointing the user to the standard disaggregation key(siteID, ID, Vs30, TR). R’s crypticregularize.values: collapsing to unique 'x' valueswarning is suppressed in favour of the new message — it is replaced, not stacked on top. Numerical behaviour is unchanged: duplicate rows are still silently collapsed viastats::approx/stats::splinefunties = "mean". SoT-validated bit-identical on clean fixtures (5/5 direct + 36/36 pipeline) and byte-equal output on duplicated input.
Internal renames (no public API change)
- Private helpers
.summarizeDn(),.summarizeDnDraws(),.aggregateWeighted()parameterp.valsrenamed topVals. Producer.sampleDnScenario()returns the list element under the new keypVals(wasp.vals). ConsumersfitDnCurve()andfitDnModel()updated to read.sample$pVals. All references are intra-package; no exported symbol changes signature. SoT-validated (Stage B helpers direct identity 3/3; Stage C swap-in-place viaassignInNamespaceover the 6 affected functions running the full fitDnCurve grid 216/216, both bit-identical).
Breaking changes
getDnKy()parameters renamed for STYLE.md compliance:ky.n→kyN,p.ref→pRef. Output is bit-identical for any call that uses the defaults or passes the args by position. Callers that passed by name must update the keyword. No live caller in the ecosystem (oqt, research scripts, MCP server, skill templates) was found to pass these by name; the rename is a clean keyword change. SoT-validated (Stage A direct identity 27/27 across 3 fixtures × 3 Ts × 3 kyN values; Stage C swap-in-place viaassignInNamespace216/216 across the full fitDnCurve pipeline).-
fitDnCurve()no longer acceptsNS.draws. The parameter was a partial-retention knob (filterdrawsto the firstNS.drawsrealisations) that no caller used; every observed call site setNS.draws = NS. The defaultNS.draws = 0Lproduceddraws = NULL, which silently brokeinvertDnDraws()for callers who followed the README pattern.drawsis now always returned as a populateddata.table(or an emptydata.tablewith the four canonical columns when no model produces output, replacing the priorNULLcorner-case return).Migration: drop
NS.draws = ...from anyfitDnCurve()call. Output forNS.draws = NScallers (the universal pattern) is bit-identical (verified across vignette + 2 real UHSTable fixtures × 3 seeds × 2 NS × 3 Ts × 2 NFC × 2 weight sets).