March 2019
Beginner to intermediate
448 pages
13h 14m
English
In this recipe, we will generate random vectors according to a bivariate Gaussian distribution. We will contaminate it and see how both the standard and the robust methods work.
library(MASS)library(robust)Sigma <- matrix(c(2,1,1,2),2,2)d <- mvrnorm(n = 1000, mu=c(5,5), Sigma)covClassic(d,cor = TRUE)
The following screenshot shows the correlation matrix estimated via classic methods

Read now
Unlock full access