sominit.pca.default: Initialise the prototypes of a SOM with PCA

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

Description

Initialise the prototypes of a Self-Organising Map with Principal Component Analysis. The prototypes are regulary positioned (according to the prior structure) in the subspace spanned by the two first principal components.

Usage

1
2
## Default S3 method:
sominit.pca(data, somgrid, weights, with.princomp=FALSE, ...)

Arguments

data

the data to which the SOM will be fitted, a matrix or data frame of observations (which should be scaled)

somgrid

a somgrid object

weights

optional weights for the data points

with.princomp

switch specifying whether the princomp should be used instead of the prcomp method for computing the principal components when no weights are given (see details)

...

not used

Details

When the optional weights are specified, the weighted covariance of the data is computed via cov.wt. Then princomp is used to find the two first principal components of the data. When weights are missing, the PCA is conducted via prcomp, expect is the function is told to use princomp via the with.princomp parameter. As a consequence, if with.princomp=FALSE, the results of the function applied to unweighted data points are likely to differ from the ones obtained on the same data points with uniform weights.

Value

A list with the following components

prototype

a matrix containing appropriate initial prototypes

data.pca

the results of the PCA conducted on the data via a call to prcomp or princomp

Author(s)

Fabrice Rossi

See Also

somgrid for specifying the prior structure and sominit.random for random based initialisations.

Examples

1
2
3
4
5
6
7
8
9
X <- cbind(rnorm(500),rnorm(500))

sg <- somgrid(xdim=7,ydim=7,topo="rect")

proto <- sominit.pca(X,sg)$prototypes

plot(X,pch="+",col="red",xlim=range(X[,1],proto[,1]),
     ylim=range(X[,2],proto[,2]))
points(proto,pch=20)

yasomi documentation built on May 2, 2019, 5:59 p.m.