## ./

# pricom__define.pro

## Class description for pricom

## Routines

`result = pricom::project(data [, nterm=nterm] [, coeffs=coeffs])`

Projects a given vector onto the vector space defined by the principal compents, and returns the result

`result = pricom::get_pc()`

Return the principal components.

`result = pricom::get_eval()`

`result = pricom::get_mean()`

`result = pricom::init(data)`

Build a new PCA object.

`pricom::cleanup`

`pricom__define`

This class provides a more convenient interface for working with principal component analysis.

## Routine details

## toppricom::project

`result = pricom::project(data [, nterm=nterm] [, coeffs=coeffs])`

Projects a given vector onto the vector space defined by the principal compents, and returns the result

### Return value

The projection of the input onto the principal components. This is equivalent to sum(coeff[i] * PC_i) where coeff[i] = sum(data * PC_i)

### Parameters

- data in required
A vector to project

### Keywords

- nterm in optional
Set to an integer to project onto only the first nterm principal components.

- coeffs in optional
Set to a variable to hold the coefficients of the linear combination of principal components. In other words, result = sum( coeff[i] * PC_i )

### Author information

- History:
March 2010: Written by Chris Beaumont April 2010: Fixed a bug that crashed this function when called with only one data point. cnb April 2010: Number of returned coeffs matches nterm. cnb. August 2010: Truncated intermediate arrays when nterm < ndim. Speeds up execution. cnb. August 10 2010: Further optimization when nterm < ndim. cnb. August 18 2010: Fixed spelling error in definition of get_mean. cnb.

## toppricom::get_eval

`result = pricom::get_eval()`

## toppricom::get_mean

`result = pricom::get_mean()`

## toppricom::init

`result = pricom::init(data)`

Build a new PCA object.

### Parameters

- data in required
an (ndim) by (nobj) array of training data. Contains (nobj) vectors, each with (ndim) elements. These are the data used to generate the principal components

## toppricom::cleanup

`pricom::cleanup`

## toppricom__define

`pricom__define`

This class provides a more convenient interface for working with principal component analysis. The user supplies a training data set, which is used to generate principal components via the IDL procedure PCOMP. The methods in this class then allow a simple way to project new vectors onto PCA space, obtain the principal components, etc.

### Author information

- History:
April 2010: Written by Chris Beaumont June 11 2010: Class now uses the cnb_pca function to calculate principal components. cnb.

## File attributes

Modifcation date: | Wed Aug 18 19:40:51 2010 |

Lines: | 144 |