Create a tidy correlation structure
Usage
correlation_structure(
n_variables,
rho = 0,
structure = c("independent", "exchangeable", "ar1", "custom"),
correlation = NULL,
variable_names = NULL
)Arguments
- n_variables
Number of variables.
- rho
Correlation coefficient used by exchangeable and AR(1) structures.
- structure
Correlation structure: one of
"independent","exchangeable","ar1", or"custom". If left unset it is chosen from the other arguments:"custom"whencorrelationis supplied,"exchangeable"when a non-zerorhois supplied, and"independent"otherwise. Passing"independent"together with a non-zerorhois a contradiction and raises asimulab_contradictory_structureerror.- correlation
Custom correlation matrix.
- variable_names
Optional variable names.