algebraMatrices function

Model matrices used in derivatives

Model matrices used in derivatives

These matrices are used in the analytic gradients

duplicationMatrix(n, diag = TRUE) eliminationMatrix(n, diag = TRUE) diagonalizationMatrix(n)

Arguments

  • n: Number of rows and columns in the original matrix
  • diag: Logical indicating if the diagonal should be included (set to FALSE for derivative of vech(x))

Author(s)

Sacha Epskamp

Returns

A sparse matrix

Examples

# Duplication matrix for 10 variables: duplicationMatrix(10) # Elimination matrix for 10 variables: eliminationMatrix(10) # Diagonailzation matrix for 10 variables: diagonalizationMatrix(10)
  • Maintainer: Sacha Epskamp
  • License: GPL-2
  • Last published: 2024-06-20