rPLSIM {covsim}R Documentation

Simulation of non-normal data

Description

Using the piecewise linear PLSIM method to simulate non-normal data

Usage

rPLSIM(
  N,
  sigma.target,
  skewness,
  excesskurtosis,
  reps = 1,
  numsegments = 4,
  gammalist = NULL,
  monot = FALSE,
  verbose = TRUE
)

Arguments

N

Number of observations to simulate.

sigma.target

Target population covariance matrix

skewness

Target skewness

excesskurtosis

Target excess kurtosis

reps

Number of simulated samples

numsegments

The number of line segments in each marginal

gammalist

A list of breakpoints in each margin

monot

True if piecewise linear functions are forced to be monotonous. The copula will then be normal.

verbose

If true, progress details of the procedure are printed

Value

A list with two elements. First element: the list of simulated samples. Second element: The fitted piecewise linear functions and the intermediate correlations matrix.

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.Under review.

Examples

set.seed(1)
sigma.target  <- cov(MASS::mvrnorm(5, rep(0,3), diag(3)))
res  <- covsim::rPLSIM(10^5, sigma.target, skewness=rep(1,3), excesskurtosis=rep(4,3))
my.sample  <- res[[1]][[1]]

[Package covsim version 1.0.0 Index]