| calibrate_plsim | R Documentation |
Performs the calibration step of the PLSIM algorithm: fits piecewise linear marginal transforms with the target skewness and kurtosis and searches for intermediate normal correlations that yield the target covariance after transformation. The (expensive) pairwise calibration is decoupled from simulation so the resulting calibration object can be reused to draw many samples without recomputation.
calibrate_plsim(
sigma.target,
skewness,
excesskurtosis,
numsegments = 4,
gammalist = NULL,
monot = FALSE,
verbose = TRUE
)
sigma.target |
Target population covariance matrix. |
skewness |
Target skewness vector. |
excesskurtosis |
Target excess kurtosis vector. |
numsegments |
The number of line segments in each marginal. |
gammalist |
A list of breakpoints in each margin. |
monot |
If |
verbose |
If |
An object of class c("covsim_calib_plsim", "covsim_calib") that
can be passed to simulate to draw samples.
Njål Foldnes (njal.foldnes@gmail.com)
Foldnes, N. and Grønneberg S. (2021). Non-normal data simulation using piecewise linear transforms.
rPLSIM, simulate
set.seed(1)
sigma.target <- cov(MASS::mvrnorm(5, rep(0, 3), diag(3)))
cal <- calibrate_plsim(sigma.target, skewness = rep(1, 3), excesskurtosis = rep(4, 3))
samples <- stats::simulate(cal, nsim = 2, N = 1000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.