R/simulate_data.R

Defines functions cov_autoregressive

Documented in cov_autoregressive

#' @title Autoregressive covariance matrix
#' @description Create autoregressive covariance matrix
#' @param p Number of features
#' @return Covariance matrix

#' @export

cov_autoregressive <- function(p){
  cov <- matrix(0,p,p)
  for (i in 1:p){
    for (j in 1:p){
      cov[i,j] = 0.5**(abs(i-j))
    }
  }
  cov
}
celiaescribe/BDcocolasso documentation built on Feb. 11, 2020, 11:41 p.m.