Computes the geometric volume (area in 2D, volume in 3D, hypervolume in higher dimensions) of a \(p\)-dimensional ellipsoid defined by its semi-axis lengths.
For semi-axes \(a_1, \dots, a_p\), the volume is: $$ V_p = \frac{\pi^{p/2}}{\Gamma(p/2 + 1)} \prod_{i=1}^{p} a_i $$ where \(\pi^{p/2} / \Gamma(p/2 + 1)\) is the volume of the unit \(p\)-dimensional ball.
In probabilistic niche models, semi-axis lengths are typically derived from covariance eigenvalues and a chi-square cutoff.
Examples
range_df <- data.frame(bio_1 = c(22, 28),
bio_12 = c(1000, 3500))
ell <- nicheR::build_ellipsoid(range = range_df)
#> Starting: building ellipsoidal niche from ranges...
#> Step: computing covariance matrix...
#> Step: computing additional ellipsoidal niche metrics...
#> Done: created ellipsoidal niche.
ell$volume
#> [1] 12056.31
# or recalculate
nicheR::ellipsoid_volume(n_dimensions = ell$dimensions, semi_axes_lengths = ell$semi_axes_lengths)
#> [1] 12056.31