| Title: | Constructs Principal Surfaces | 
| Version: | 1.0 | 
| Description: | Construct a principal surface that are two-dimensional surfaces that pass through the middle of a p-dimensional data set. They minimise the distance from the data points, and provide a nonlinear summary of data. The surfaces are nonparametric and their shape is suggested by the data. The formation of a surface is found using an iterative procedure which starts with a linear summary, typically with a principal component plane. Each successive iteration is a local average of the p-dimensional points, where an average is based on a projection of a point onto the nonlinear surface of the previous iteration. For more information on principal surfaces, see Ganey, R. (2019, "https://open.uct.ac.za/items/4e655d7d-d10c-481b-9ccc-801903aebfc8"). | 
| License: | MIT + file LICENSE | 
| Encoding: | UTF-8 | 
| RoxygenNote: | 7.3.1 | 
| Imports: | rgl | 
| Suggests: | stats, Matrix, akima, knitr, rmarkdown | 
| VignetteBuilder: | knitr | 
| NeedsCompilation: | no | 
| Packaged: | 2025-03-10 16:26:16 UTC; raeesaganey | 
| Author: | Raeesa Ganey  | 
| Maintainer: | Raeesa Ganey <Raeesa.ganey@wits.ac.za> | 
| Repository: | CRAN | 
| Date/Publication: | 2025-03-12 17:30:12 UTC | 
Principal Surface
Description
A function to compute principal surfaces based on input data containing continuous variables.
Usage
principal.surface(
  X,
  max.iter = 10,
  alpha = 0.6,
  N = 50,
  print_iterations = FALSE
)
Arguments
X | 
 A data frame or matrix containing continuous variables.  | 
max.iter | 
 Integer. Maximum number of iterations for the principal surface algorithm.  | 
alpha | 
 Numeric. The span argument passed to the   | 
N | 
 Integer. The resolution for the interpolated grid surface, creating an   | 
print_iterations | 
 Logical. Should the iterations in the principal surface algorithm be printed? Defaults to   | 
Value
A list with the following components:
fj.matA numeric
n \times pmatrix of the final principal surface fitted values.lambda.jA numeric representation of the samples in two dimensions.
Examples
surface <- principal.surface(iris[,1:3],max.iter = 3)
surface <- principal.surface(iris[1:50,1:3],max.iter = 3)