Statistical estimators of the distribution of a set of vectors
Usage
# S3 method for class 'spherical'
mean(x, w = NULL, na.rm = TRUE)
mean(x, ...)
sd(x, ...)
# S3 method for class 'spherical'
sd(x, w = NULL, na.rm = TRUE)
var(x, ...)
# S3 method for class 'spherical'
var(x, w = NULL, na.rm = TRUE)
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"
, or"Plane"
.- w
numeric. Optional weights for each observation.
- na.rm
logical. Whether
NA
values should be removed before the computation proceeds.- ...
arguments passed to function call
- alpha
numeric. Significance level for the confidence angle (default is 0.05 for a 95% confidence angle).
Details
mean
returns the spherical mean of a set of vectors
(object of class of x
).
var
returns the spherical variance (numeric), based on resultant length
(Mardia 1972).
delta
returns the cone angle containing ~63% of the data (in degree 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.
confidence_angle
returns the semi-vertical angle \(q\) about the
mean \(\mu\) (in degree 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).
Examples
set.seed(20250411)
x <- rvmf(100, mu = Line(120, 50), k = 5)
mean(x)
#> Line object (n = 1):
#> azimuth plunge
#> 115.21007 52.67744
var(x)
#> [1] 0.224176
delta(x)
#> [1] 39.1202
rdegree(x)
#> [1] 0.551648
sd_error(x)
#> [1] 4.01451
confidence_angle(x)
#> [1] 6.965534
estimate_k(x)
#> [1] 4.673486
#' weights:
x2 <- Line(c(0, 0), c(0, 90))
mean(x2)
#> Line object (n = 1):
#> azimuth plunge
#> 0 45
mean(x2, w = c(1, 2))
#> Line object (n = 1):
#> azimuth plunge
#> 0.00000 63.43495
var(x2)
#> [1] 0.2928932
var(x2, w = c(1, 2))
#> [1] 0.254644