Statistical estimators of the distribution of a set of vectors
Usage
sph_mean(x, na.rm = TRUE, ...)
sph_sd(x, ...)
sph_var(x, ...)
sph_confidence_angle(x, w = NULL, alpha = 0.05, na.rm = TRUE)
rdegree(x, w = NULL, na.rm = FALSE)
sd_error(x, w = NULL, na.rm = FALSE)
delta(x, w = NULL, na.rm = TRUE)
estimate_k(x, w = NULL, na.rm = FALSE)Arguments
- x
object of class
"Vec3","Line","Ray", or"Plane".- na.rm
logical. Whether
NAvalues should be removed before the computation proceeds.- ...
arguments passed to function call
- w
numeric. Optional weights for each observation.
- alpha
numeric. Significance level for the confidence angle (default is 0.05 for a 95% confidence angle).
Details
sph_mean returns the spherical arithmetic mean of a set of vectors
(object of class of x).
sph_var returns the spherical variance (numeric), based on resultant length
(Mardia 1972).
sph_sd returns the spherical standard deviation (numeric) given as the half
apical angle of a cone about the mean vector. In degrees if x is a
"Plane" or "Line", or in radians if otherwise.
delta returns the half apical angle of the cone containing ~63% of the data
(in degrees if x is a "Plane" or "Line", or in radians
if otherwise). For enough large sample it approaches the angular standard
deviation ("csd") of the Fisher statistics.
rdegree returns the degree of preferred orientation of vectors, range: (0, 1).
sd_error returns the spherical standard error (numeric). If the number of
data is less than 25, if will print a additional message, that the output
value might not be a good estimator.
sph_confidence_angle returns the half-apical angle \(q\) of a cone about the
mean \(\mu\) (in degrees if x is a "Plane" or "Line", or in radians
if otherwise). The \(100(1-\alpha)\%\) confidence interval is than given by \(\mu \pm q\).
estimate_k returns the estimated concentration of the von Mises-Fisher distribution \(\kappa\) (after Sra, 2011).
See also
projected_mean() for projected mean, geodesic_mean_line() and geodesic_mean_pair() for the geodesic mean of lines and pairs, respectively.
or geodesic_mean() and geodesic_var() as a convenience wrapper for all spherical data types.
Examples
set.seed(20250411)
x <- rvmf(100, mu = Line(120, 50), k = 5)
sph_mean(x)
#> Line object (n = 1):
#> azimuth plunge
#> 115.21007 52.67744
sph_sd(x)
#> [1] 40.82336
sph_var(x)
#> [1] 0.224176
delta(x)
#> [1] 39.1202
rdegree(x)
#> [1] -0.9844835
sd_error(x)
#> [1] 4.01451
sph_confidence_angle(x)
#> [1] 6.965534
estimate_k(x)
#> [1] 4.673486
#' weights:
x2 <- Line(c(0, 0), c(0, 90))
sph_mean(x2)
#> Line object (n = 1):
#> azimuth plunge
#> 0 45
sph_mean(x2, w = c(1, 2))
#> Line object (n = 1):
#> azimuth plunge
#> 0.00000 63.43495
sph_var(x2)
#> [1] 0.2928932
sph_var(x2, w = c(1, 2))
#> [1] 0.254644