Learn R Programming

kldest (version 1.0.0)

constDiagMatrix: Constant plus diagonal matrix

Description

Specify a matrix with constant values on the diagonal and on the off-diagonals. Such matrices can be used to vary the degree of dependency in covariate matrices, for example when evaluating accuracy of KL-divergence estimation algorithms.

Usage

constDiagMatrix(dim = 1, diag = 1, offDiag = 0)

Value

A dim-by-dim matrix

Arguments

dim

Dimension

diag

Value at the diagonal

offDiag

Value at off-diagonals

Examples

Run this code
constDiagMatrix(dim = 3, diag = 1, offDiag = 0.9)

Run the code above in your browser using DataLab