## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")

## ----simulate-----------------------------------------------------------------
library(HDElliptical)

set.seed(1)
shape <- matrix(c(2, 0.6, 0.6, 1), 2)
x <- relliptical(
  150,
  location = c(1, -1),
  shape = shape,
  radial = function(n) abs(rt(n, df = 3))
)

## ----median-sign--------------------------------------------------------------
center <- spatial_median(x)
center
attr(center, "converged")
attr(center, "equation_residual")

sign_shape <- sscm(x, center = center)
sum(diag(sign_shape))

## ----rank-matrices------------------------------------------------------------
kendall_shape <- spatial_kendall(x)
rank_shape <- spatial_rank_covariance(x)
c(kendall_trace = sum(diag(kendall_shape)),
  rank_trace = sum(diag(rank_shape)))

## ----tyler--------------------------------------------------------------------
tyler <- tyler_shape(x)
sum(diag(tyler))
attr(tyler, "converged")
attr(tyler, "equation_residual")

## ----hr-----------------------------------------------------------------------
hr <- hr_estimator(x)
hr$location
hr$shape
c(location = hr$location_equation_residual,
  shape = hr$shape_equation_residual)

