make_corr: Build a correlation matrix with a given structure

View source: R/mvdist.R

make_corrR Documentation

Build a correlation matrix with a given structure

Description

Build a correlation matrix with a given structure

Usage

make_corr(
  d,
  type = c("exchangeable", "ar1", "toeplitz", "random", "identity"),
  rho = 0.5,
  names = NULL
)

Arguments

d

Dimension.

type

Structure: "exchangeable" (all off-diagonal entries rho), "ar1" (⁠rho^|i-j|⁠), "toeplitz" (first row given by rho, a vector of length d - 1), "random" (a random positive-definite correlation matrix) or "identity".

rho

Correlation parameter (see type).

names

Optional variable names.

Value

A ⁠d x d⁠ correlation matrix.

Examples

make_corr(4, "ar1", rho = 0.7)
make_corr(3, "toeplitz", rho = c(0.5, 0.2))

SynthesizerPlus documentation built on Oct. 16, 2026, 5:10 p.m.