IntrinsicMean: Finding Intrinsic Mean

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/spherepc.R

Description

This function calculates the intrinsic mean of data on sphere.

Usage

1
IntrinsicMean(data, weights = rep(1, nrow(data)), thres = 1e-5)

Arguments

data

matrix or data frame consisting of spatial locations with two columns. Each row represents longitude and latitude (denoted by degrees).

weights

vector of weights.

thres

threshold of the stopping conditions.

Details

This function calculates the intrinsic mean of data. The intrinsic mean is found by the gradient descent algorithm, which works well if the data is well-localized. In the case of spheres, if data is contained in a hemisphere, then the algorithm converges.

Value

two-dimensional vector.

Author(s)

Jongmin Lee

References

Fletcher, P. T., Lu, C., Pizer, S. M. and Joshi, S. (2004). Principal geodesic analysis for the study of nonlinear statistics of shape. IEEE Transactions on Medical Imaging, 23, 995-1005. Jongmin Lee, Jang-Hyun Kim and Hee-Seok Oh. (2021). Spherical Principal Curves. IEEE Transactions on Pattern Analysis and Machine Intelligence, 43. 2165-2171. <doi.org/10.1109/TPAMI.2020.3025327>.

See Also

ExtrinsicMean.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#### comparison of Intrinsic mean and extrinsic mean.
#### example: circular data set.
library(rgl)
library(sphereplot)
library(geosphere)
n <- 500
x <- 360 * runif(n) - 180
sigma <- 5
y <- 60 + sigma * rnorm(n)
simul.circle <- cbind(x, y)
data <- simul.circle
In.mean <- IntrinsicMean(data)
Ex.mean <- ExtrinsicMean(data)
## plot (color of data is "blue"; that of intrinsic mean is "red" and 
## that of extrinsic mean is "green".)
sphereplot::rgl.sphgrid()    
sphereplot::rgl.sphpoints(data, radius = 1, col = "blue", size = 12)
sphereplot::rgl.sphpoints(In.mean[1], In.mean[2], radius = 1, col = "red", size = 12)
sphereplot::rgl.sphpoints(Ex.mean[1], Ex.mean[2], radius = 1, col = "green", size = 12)

spherepc documentation built on Oct. 7, 2021, 9:14 a.m.