Last data update: 2014.03.03

R: Projection onto LPC
lpc.projectR Documentation

Projection onto LPC

Description

Projects a new observation onto the spline representation of the local principal curve.

Usage

lpc.project(object, newdata, ...)

Arguments

object

Object of class lpc or lpc.spline.

newdata

A data frame containing the new data to be projected.

...

Additional arguments to be passed to lpc.project.spline.

Value

closest.pi

Projection index of projected point(s) (in cubic spline parametrization).

closest.or.pi

Projection index of projected point(s) (in terms of the original LPC parametrization).

closest.coords

Coordinates of projected data point(s)

closest.dist

Euclidean distance between data point(s) and their projected counterpart(s).

closest.branch

ID of branch onto which the data point was projected (the IDs get allocated in the output component $Parametrization of function lpc).

Note

The parametrization of the cubic spline function is not exactly the same as that of the original LPC. The reason is that the latter uses Euclidean distances between centers of masses, while the former uses the arc length along the cubic spline. The differences are normally quite small, though.

Author(s)

J. Einbeck and L. Evers

References

Einbeck, J., Evers, L. & Hinchliff, K. (2010): Data compression and regression based on local principal curves. In A. Fink, B. Lausen, W. Seidel, and A. Ultsch (Eds), Advances in Data Analysis, Data Handling, and Business Intelligence, Heidelberg, pp. 701–712, Springer.

See Also

lpc, lpc.spline

Examples

data(gvessel)
gvessel.lpc <- lpc(gvessel[,c(2,4,5)], scaled=TRUE,   h=0.11,  x0=c(35, 1870, 6.3))
lpc.project(gvessel.lpc, newdata=data.frame(salg=35,dephtg= 2000,oxyg=6))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(LPCM)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/LPCM/lpc.project.Rd_%03d_medium.png", width=480, height=480)
> ### Name: lpc.project
> ### Title: Projection onto LPC
> ### Aliases: lpc.project
> ### Keywords: multivariate
> 
> ### ** Examples
> 
> data(gvessel)
> gvessel.lpc <- lpc(gvessel[,c(2,4,5)], scaled=TRUE,   h=0.11,  x0=c(35, 1870, 6.3))
> lpc.project(gvessel.lpc, newdata=data.frame(salg=35,dephtg= 2000,oxyg=6))
$closest.pi
[1] 1.832189

$closest.or.pi
[1] 1.826806

$closest.coords
        [,1]      [,2]     [,3]
[1,] 40.5642 0.3213447 2.313875

$closest.dist
[1] 0.1088116

$closest.branch
[1] 0

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>