covEstR

CRAN_Status_Badge CRAN_Downloads_Badge codecov Travis-CI Build Status

Overview

covEstR is a covariance estimation suite. In creating other packages we found it useful to separate out our covariance estimation functions and maintain them somewhere else. This package works well with hldr and covTestR.

In developing covEstR we found it useful to have it play nice with the tidyverse suite of packages. At this point we have not thought of all the uses and combinations with these packages, so if you think of something not currently implemented please file a minimal reproducible example on GitHub.

Currently, we have written the Haff shrinkage estimator 1979, but we are open to adding other covariance and precision matrix estimating functions. Note that our cov() function can return either covariance or precision matrices, depending on the function supplied to the covEstR argument. Please file an enhancement request on GitHub, and please include the following details in the request:

Installation

You can install the latest development version from GitHub with

if (packageVersion("devtools") < 1.6) {
  install.packages("devtools")
}
devtools::install_github("BenBarnard/covEstR")

If you encounter a clear bug, please file a minimal reproducible example on GitHub.

Example

This is a basic example which shows you how to solve a common problem:

library(tidyverse)
library(covEstR)

# Total Precision
iris %>% select(-Species) %>% as.matrix %>% Haff_shrinkage

# Group Precision matrix estimates using our cov() function with the unbiased
#   estimator
cov(iris, group = "Species") %>% lapply(solve)

# Group Precision matrix estimates using our cov() function with the Haff
#   Shrinkage Estimator
cov(iris, group = "Species", covEst = Haff_shrinkage)


BenBarnard/covEstR documentation built on May 7, 2019, 7:58 a.m.