BayesianCalculateMatrix: Calculate Covariance Matrix from a linear model fitted with lm() using different estimators
Description
Calculates covariance matrix using the maximum likelihood estimator, the maximum a posteriori (MAP)
estimator under a regularized Wishart prior, and if the sample is large enough can give samples from the
posterior and the median posterior estimator.
Estimated covariance matrices and posterior samples
Arguments
linear.m
Linear model adjusted for original data
samples
number os samples to be generated from the posterior. Requires sample size to be at least as large as the number of dimensions
...
additional arguments, currently ignored
nu
degrees of freedom in prior distribution, defaults to the number of traits (this can be a too strong prior)
S_0
cross product matrix of the prior. Default is to use the observed variances and zero covariance
Author
Diogo Melo, Fabio Machado
References
Murphy, K. P. (2012). Machine learning: a probabilistic perspective. MIT press.
Schafer, J., e Strimmer, K. (2005). A shrinkage approach to large-scale covariance matrix estimation and implications for functional genomics. Statistical applications in genetics and molecular biology, 4(1).