pns: Principal Nested Spheres

View source: R/shapes.R

pnsR Documentation

Principal Nested Spheres

Description

Calculation of Principal Nested Spheres

Usage

pns(x, sphere.type = "seq.test", alpha = 0.1, R = 100, 
                              nlast.small.sphere = 1, output=TRUE)

Arguments

x

a (d + 1) x n data matrix where each column is a unit vector in S^d and n is the sample size.

sphere.type

a character string specifying the type of sphere fitting method. "seq.test" specifies sequential tests to decide either "small" or "great"; "small" specifies Principal Nested SMALL Sphere; "great" specifies Principal Nested GREAT Sphere (radius pi/2); "BIC" specifies BIC statistic to decide either "small" or "great"; and "bi.sphere" specifies Principal Nested GREAT Sphere for the first part and Principal Nested SMALL Sphere for last parts. The default is "seq.test".

alpha

significance level (0 < alpha < 1) used when sphere.type = "seq.test". The default is 0.1.

R

the number of bootstrap samples to be evaluated for the sequential test. The default is 100.

nlast.small.sphere

the number of small spheres in the finishing part used when sphere.type = "bi.sphere".

output

Logical. If TRUE then plots and some brief printed summaries are given. If FALSE then no plots or output is given.

Value

A list with components

resmat

the residual matrix (X_PNS). Each entry in row k works like the kth principal component

$PNS

= the list with the following components.

radii

the size (radius) of PNS.

orthaxis

the orthogonal axis v_i of subspheres.

dist

the distance r_i of subspheres

pvalues

the p-values of LRT and parametric boostrap tests (if any).

ratio

the estimated ratios. Now unavailable.

mean

the location of the PNS mean.

sphere.type

the type of method for fitting subspheres.

percent

proportion of variances explained.

spherePNS

The co-ordinates of the data points projected to the sphere in 3D (also plotted)

circlePNS

The co-ordinates of the 2D circle projections on the sphere in 3D (also plotted)

Author(s)

Kwang-Rae Kim: R translation of Sungkyu Jung's matlab code

References

Dryden, I.L., Kim, K., Laughton, C.A. and Le, H. (2019). Principal nested shape space analysis of molecular dynamics data. Annals of Applied Statistics, 13, 2213-2234.

Jung, S., Dryden, I.L. and Marron, J.S. (2012). Analysis of principal nested spheres. Biometrika, 99, 551-568.

See Also

pns4pc, pnss3d

Examples


#  out <- pc2sphere(x = gorf.dat, n.pc = 2)
#  spheredata <- t(out$spheredata)
#  pns.out <- pns(x = spheredata)


shapes documentation built on Feb. 16, 2023, 8:16 p.m.