function [Sigma] = generate_feature_covariance(p, type, rho)

    % inputs:
    % p = number of features
    % type = type of covariance
    % different types = isotropic, autoregressive, equicorrelated
    % outputs:
    % Sigma = feature covariance
    
    if strcmp(type, 'iso')
        Sigma = eye(p);
    end
    
    if strcmp(type, 'auto')
        Sigma = toeplitz(rho.^(0:1:p-1));
    end
    
    if strcmp(type, 'equi')
        Sigma = (1 - rho) * eye(p) + rho * ones(p, 1) * ones(p, 1)';
    end
end