% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sampleSaCorr.R
\name{sampleSaCorr}
\alias{sampleSaCorr}
\title{Draw a correlated sample of spectral accelerations}
\usage{
sampleSaCorr(uhs, Tn, rho, NS)
}
\arguments{
\item{uhs}{data.table with columns Tn, p, Sa (must include p == "mean").}

\item{Tn}{numeric vector; the first element is the reference period \code{Tn[1]},
e.g., 0.01 or 0.00. It does not have to be sorted.}

\item{rho}{numeric vector of length \code{length(Tn) - 1}; correlations between the
reference period \code{Tn[1]} and each remaining period.}

\item{NS}{integer, Monte Carlo sample size.}
}
\value{
matrix of dimension NS x length(Tn) with Sa draws (g).
}
\description{
Draw a correlated sample of spectral accelerations
}
\examples{
\dontrun{
uhs <- data.table::data.table(
  Tn = c(0, 0, 0, 1, 1, 1),
  p  = c("0.16", "mean", "0.84", "0.16", "mean", "0.84"),
  Sa = c(0.3, 0.5, 0.7, 0.1, 0.2, 0.3)
)
rho <- rhoBJ(Tn = 1.0, T0 = 0.01)
mat <- sampleSaCorr(uhs, Tn = c(0, 1), rho = rho, NS = 100)
}
}
