calibrate_plsim: Calibrate the PLSIM (Piecewise Linear) model

View source: R/PLSIM.R

calibrate_plsimR Documentation

Calibrate the PLSIM (Piecewise Linear) model

Description

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.

Usage

calibrate_plsim(
  sigma.target,
  skewness,
  excesskurtosis,
  numsegments = 4,
  gammalist = NULL,
  monot = FALSE,
  verbose = TRUE
)

Arguments

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 TRUE, piecewise linear functions are forced to be monotonous. The implied copula is then normal.

verbose

If TRUE, prints calibration progress.

Value

An object of class c("covsim_calib_plsim", "covsim_calib") that can be passed to simulate to draw samples.

Author(s)

Njål Foldnes (njal.foldnes@gmail.com)

References

Foldnes, N. and Grønneberg S. (2021). Non-normal data simulation using piecewise linear transforms.

See Also

rPLSIM, simulate

Examples

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)

covsim documentation built on Oct. 29, 2026, 5:06 p.m.