matrix-constructors: Constructors for structured correlation and covariance matrix

matrix-constructorsR Documentation

Constructors for structured correlation and covariance matrix

Description

Correlation and covariance matrices are assumed to be symmetrics, semi-positive definite. In the case of correlation matrices, the diagonal elements should be 1 and the off-diagonal elements between -1 and 1 inclusive.

Usage

matrix_id(n, vars = 1, names = NULL, inverse_return = FALSE)

matrix_diag(n, vars = 1, names = NULL, inverse_return = FALSE)

matrix_cs(n, rho = 0, vars = 1, names = NULL, inverse_return = FALSE)

matrix_ar1(n, rho = 0, vars = 1, names = NULL, inverse_return = FALSE)

matrix_tp(n, rho = 0, vars = 1, names = NULL, inverse_return = FALSE)

matrix_ad1(n, u, vars = 1, names = NULL, inverse_return = FALSE)

Arguments

n

The dimension of the matrix.

vars

A vector of diagonal variances or a single variance.

names

Optional character vector of the same size as n.

inverse_return

Whether to return the inverse or not.

rho

The

Functions

  • matrix_id: Identity matrix.

  • matrix_diag: A synonym for matrix_id.

  • matrix_cs: Compound symmetric matrix.

  • matrix_ar1: First order autoregressive order matrix.

  • matrix_tp: Toeplitz.

  • matrix_ad1: First order ante-dependence order matrix.


emitanaka/simulate documentation built on July 1, 2022, 9:32 a.m.