Description Usage Arguments Details Value Note Author(s) References See Also Examples
This function performs principal geodesic analysis.
1 |
data |
matrix or data frame consisting of spatial locations with two columns. Each row represents longitude and latitude (denoted by degrees. |
col1 |
color of data. The default is blue. |
col2 |
color of the principal geodesic line. The default is red |
This function performs principal geodesic analysis.
plot and a list consisting of
line |
spatial locations (longitude and latitude by degrees) of points in the principal geodesic line. |
This function requires to load 'sphereplot', 'geosphere' and 'rgl' R package.
Jongmin Lee
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.
LPG
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library(rgl)
library(sphereplot)
library(geosphere)
#### example 1: noisy half-great circle data
circle <- GenerateCircle(c(150, 60), radius = pi/2)
half.circle <- circle[circle[, 1] < 0, , drop = FALSE]
sigma <- 2
half.circle <- half.circle + sigma * rnorm(nrow(half.circle))
PGA(half.circle)
#### example 2: noisy S-shaped data
#### The data consists of two parts: x ~ Uniform[0, 20], y = sqrt(20 * x - x^2) + N(0, sigma^2),
#### x ~ Uniform[-20, 0], y = -sqrt(-20 * x - x^2) + N(0, sigma^2).
n <- 500
x <- 60 * runif(n)
sigma <- 2
y <- (60 * x - x^2)^(1/2) + sigma * rnorm(n)
simul.S1 <- cbind(x, y)
z <- -60 * runif(n)
w <- -(-60 * z - z^2)^(1/2)+ sigma * rnorm(n)
simul.S2 <- cbind(z, w)
simul.S <- rbind(simul.S1, simul.S2)
PGA(simul.S)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.