% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fitSaF.R
\name{fitSaF}
\alias{fitSaF}
\title{Site-amplified AUXtral acceleration (Seyhan & Stewart 2014)}
\usage{
fitSaF(
  uhs,
  vs30,
  vref = 760,
  ns = 1000,
  models = "ST17",
  Rrup = 100,
  p_TARGET = c(0.05, 0.1, 0.16, 0.5, 0.84, 0.9, 0.95)
)
}
\arguments{
\item{uhs}{data.table with columns Tn, p, Sa.}

\item{vs30}{target Vs30 (m/s).}

\item{vref}{reference Vs30 (m/s), default 760.}

\item{ns}{Monte Carlo size (default 1000).}

\item{models}{character. Site-response model id. Currently the only
implemented model is \code{"ST17"}; reserved for future
site-response models.}

\item{Rrup}{rupture distance (km) for rhoBJ() in the quantile case (default 100).}

\item{p_TARGET}{probabilities to report when only 'mean' is provided,
default c(0.05, 0.10, 0.16, 0.50, 0.84, 0.90, 0.95).}
}
\value{
data.table with columns Tn, p, Sa, SaF, AF.
}
\description{
Computes site-amplified AUXtral acceleration using two modes:
(A) If the input UHS contains only p == "mean", rock Sa is treated as
deterministic and the dispersion in SaF comes solely from F_ST17
(sdLnF), sampled on the natural-log scale.
(B) If the input UHS contains numeric quantiles (e.g., "0.10", "0.50", ...),
ln Sa(Tn) is sampled from those quantiles using an empirical inverse
quantile function (buildQSpline). Dependence between PGA and Sa(Tn)
is represented by a Gaussian "star" copula (Baker & Jayaram, 2009)
with correlation rhoBJ(Tn, T0 = 0, Rrup). For each Monte Carlo draw,
F_ST17 is evaluated with the paired PGA draw, and ln SaF = ln Sa + ln F
with ln F ~ Normal(muLnF, sdLnF). Independence between ln Sa and ln F
is assumed.
}
\details{
Requirements:
\itemize{
\item The input table must have columns Tn, p, Sa.
\item It must include exactly one row (Tn == 0, p == "mean") providing PGA on rock.
}

Output columns: Tn, p, Sa, SaF, AF, where AF = SaF / Sa.
In mode (B), the same numeric p values found in the input are returned plus
"mean". In mode (A), the set of p values is taken from p_TARGET plus "mean".
}
\examples{
\dontrun{
uhs <- data.table::fread(
  system.file("extdata", "uhs.csv", package = "newmark"))
fitSaF(uhs, vs30 = 360, vref = 760, ns = 500)
}
}
