Represents generalized ellipsoids with the "(U,D)" representation, allowing both degenerate and unbounded ellipsoids, together with methods for linear and duality transformations, and for plotting. This permits exploration of a variety to statistical issues that can be visualized using ellipsoids as discussed by Friendly, Fox & Monette (2013), "Elliptical Insights: Understanding Statistical Methods and duality transformations, and for plotting. The ideas are described in Friendly, Monette & Fox (2013) doi:10.1214/12-STS402 .
Details
It uses the (U, D) representation of generalized ellipsoids in \(R^d\), where \(U\) is square orthogonal and \(D\) is diagonal with extended non-negative real numbers, i.e. 0, Inf or a positive real). These are roughly analogous to the corresponding terms in the singular-value decomposition of a matrix, \(X = U D V'\).
The resulting class of ellipsoids includes degenerate ellipsoids that are flat and/or unbounded. Thus ellipsoids are naturally extended to include lines, hyperplanes, points, cylinders, etc.
The class is closed under linear and affine transformations (including those between spaces of different dimensions) and under duality ('inverse') transformations.
Unbounded ellipsoids, e.g. cylinders with elliptical cross-sections, correspond to singular inner products, i.e. inner products defined by a singular inner product matrix.
Flat ellipsoids correspond to singular variances. The corresponding inner product is defined only on the supporting subspace.
Ellipsoids that are both flat and unbounded correspond to lines, points, subspaces, hyperplanes, etc.
gell
can currently generate the U-D representation from 5 ways
of specifying an ellipsoid:
From the non-negative definite dispersion (variance) matrix, Sigma: \(U D^2 U' = \Sigma\), where some elements of the diagonal matrix D can be 0. This can only generate bounded ellipsoids, possibly flat.
From the non-negative definite inner product matrix 'ip': \(U W^2 U = C\) where some elements of the diagonal matrix W can be 0. Then set D = W^-1 where 0^-1 = Inf. This can only generate fat (non-empty interior) ellipsoids, possibly unbounded.
From a subspace spanned by 'span' Let U_1 be an orthonormal basis of Span('span'), let U_2 be an orthonormal basis of the orthogonal complement, the U = [ U_1 U_2 ] and D = diag( c(Inf,...,Inf, 0,..,0)) where the number of Inf's is equal to the number of columns of U_1.
From a transformation of the unit sphere given by A(Unit sphere) where \(A = U D V'\), i.e. the SVD.
(Generalization of 4): (A, d) where A is any matrix and d is a vector of factors corresponding to columns of A. These factors can be 0, positive or Inf. In this case U and D are such that U D(Unit sphere) = A diag(d)(Unit sphere). This is the only representation that can be used for all forms of ellipsoids and in which any ellipsoid can be represented.
References
Friendly, M., Monette, G. and Fox, J. (2013). Elliptical Insights: Understanding Statistical Methods through Elliptical Geometry. Statistical Science, 28(1), 1-39. Online: https://www.datavis.ca/papers/ellipses-STS402.pdf, DOI: doi:10.1214/12-STS402
Examples
(zsph <- gell(Sigma = diag(3))) # unit sphere in R^3
#> $center
#> [1] 0 0 0
#>
#> $u
#> [,1] [,2] [,3]
#> [1,] 0 0 1
#> [2,] 0 1 0
#> [3,] 1 0 0
#>
#> $d
#> [1] 1 1 1
#>
#> attr(,"class")
#> [1] "gell"
(zplane <- gell(span = diag(3)[, 1:2])) # a plane
#> $center
#> [1] 0 0 0
#>
#> $u
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#> [2,] 0 1 0
#> [3,] 0 0 1
#>
#> $d
#> [1] Inf Inf 0
#>
#> attr(,"class")
#> [1] "gell"
dual(zplane) # line orthogonal to that plane
#> $center
#> [1] 0 0 0
#>
#> $u
#> [,1] [,2] [,3]
#> [1,] 0 0 1
#> [2,] 0 1 0
#> [3,] 1 0 0
#>
#> $d
#> [1] Inf 0 0
#>
#> attr(,"class")
#> [1] "gell"
(zhplane <- gell(center = c(0, 0, 2), span = diag(3)[, 1:2])) # a hyperplane
#> $center
#> [1] 0 0 2
#>
#> $u
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#> [2,] 0 1 0
#> [3,] 0 0 1
#>
#> $d
#> [1] Inf Inf 0
#>
#> attr(,"class")
#> [1] "gell"
dual(zhplane) # orthogonal line through same center (note that the 'gell'
#> $center
#> [1] 0 0 2
#>
#> $u
#> [,1] [,2] [,3]
#> [1,] 0 0 1
#> [2,] 0 1 0
#> [3,] 1 0 0
#>
#> $d
#> [1] Inf 0 0
#>
#> attr(,"class")
#> [1] "gell"
# object with a center contains more information than the geometric plane)
zorigin <- gell(span = cbind(c(0, 0, 0)))
dual(zorigin)
#> $center
#> [1] 0 0 0
#>
#> $u
#> [,1] [,2] [,3]
#> [1,] 0 0 1
#> [2,] 0 1 0
#> [3,] 1 0 0
#>
#> $d
#> [1] Inf Inf Inf
#>
#> attr(,"class")
#> [1] "gell"
# signatures of these ellipsoids
signature(zsph)
#> pos zero inf
#> 3 0 0
signature(zhplane)
#> pos zero inf
#> 0 1 2
signature(dual(zhplane))
#> pos zero inf
#> 0 2 1