cov_block_autocorrelation: Generates a p \times p block-diagonal covariance matrix with...

Description Usage Arguments Details Value


This function generates a p \times p covariance matrix with autocorrelated blocks. The autocorrelation parameter is rho. There are num_blocks blocks each with size, block_size. The variance, sigma2, is constant for each feature and defaulted to 1.


cov_block_autocorrelation(num_blocks, block_size, rho, sigma2 = 1)



the number of blocks in the covariance matrix


the size of each square block within the covariance matrix


the autocorrelation parameter. Must be less than 1 in absolute value.


the variance of each feature


The autocorrelated covariance matrix is defined as:

Σ = Σ^{(ρ)} \oplus Σ^{(-ρ)} \oplus … \oplus Σ^{(ρ)},

where \oplus denotes the direct sum and the (i,j)th entry of Σ^{(ρ)} is

Σ_{ij}^{(ρ)} = \{ ρ^{|i - j|} \}.

The matrix Σ^{(ρ)} is the autocorrelated block discussed above.

The value of rho must be such that |ρ| < 1 to ensure that the covariance matrix is positive definite.

The size of the resulting matrix is p \times p, where p = num_blocks * block_size.


autocorrelated covariance matrix

Search within the sparsediscrim package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.