# Figmerit

### Purpose

Analytical figures of merit for multivariate calibration.

### Synopsis

- [nas,nnas,sens,sel] = figmerit(x,y,b);

### Description

Calculates analytical figures of merit for PLS and PCR standard model structures. Inputs are the preprocessed (usually centered and scaled) spectral data `x`, the preprocessed analyte data `y`, and the regression vector, `b`. Note that for standard PLS and PCR structures `b = model.reg`.

The outputs are the matrix of net analyte signals `nas` for each row of `x`, the norm of the net analyte signal for each row `nnas` (this is corrected to include the sign of the prediction), the matrix of sensitivities for each sample `sens`, and the vector of selectivities for each sample `sel` (sel is always non-negative).

Note that the "noise-filtered" estimate present in previous versions is no longer used because an improved method for calculating the net analyte vector makes it redundant.

#### Inputs

**x**= x-block data, normally centered and scaled**y**= y-block data, preprocessed**b**= regression vector. Standard PLS_Toolbox PLS and PCR structures contain this vector in the`.reg`field.

#### Outputs

**nas**= net analyte signals for each row of`x`.**nnas**= norm of the net analyte signal for each row.**sens**= matrix of sensitivities for each sample.**sel**= vector of selectivities for each sample.

### Examples

Given the 7 LV PLS model:

modl = pls(x,y,7); [nas,nnas,sens,sel] = figmerit(x,y,modl.reg);

Given the 5 PC PCR model:

modl = pcr(auto(x),auto(y),5); [nas,nnas,sens,sel] = figmerit(auto(x),auto(y),modl.reg);