cov_block_autocorrelation {sparsediscrim} | R Documentation |
Generates a
block-diagonal covariance matrix with
autocorrelated blocks.
Description
This function generates a 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.
Usage
cov_block_autocorrelation(num_blocks, block_size, rho, sigma2 = 1)
Arguments
num_blocks |
the number of blocks in the covariance matrix |
block_size |
the size of each square block within the covariance matrix |
rho |
the autocorrelation parameter. Must be less than 1 in absolute value. |
sigma2 |
the variance of each feature |
Details
The autocorrelated covariance matrix is defined as:
where denotes the direct sum and the
th entry of
is
The matrix is the autocorrelated block discussed above.
The value of rho
must be such that to ensure that
the covariance matrix is positive definite.
The size of the resulting matrix is , where
p = num_blocks * block_size
.
Value
autocorrelated covariance matrix