# Orthogonal Signal Correction

### What it does

The function **osccalc.m** calculates the orthogonal signal
correction parameters for preprocessing a spectral data prior
to developing a PLS model. In situations where the a PLS model
captures a very large amount of predictor block (**X**) variance
in the first factor but gets very little of the predicted variable
(**y** or **Y**) it can be very helpful. In these cases
it is useful to remove extraneous variance from **X** that
is unrelated to **y**. OSC does this by finding directions
in **X** that describe large amounts of variance while being
orthogonal to **y**. Models are built on OSC corrected data,
then the OSC correction is applied before application of the PLS
models to new data.

In the example shown below, some NIR of diesel fuels is loaded
into the workspace, along with the reference viscosity values.
A calibration set is produced, and one and two factor OSC corrections
are calculated. PLS models are then built on the raw data, and
the OSC corrected data. Note how the PLS model built on OSC corrected
data grabs a much larger amount of **y** variance in the first
factor. The correction is then applied to the test data, and new
predictions are made from the models. A comparison
of the prediction errors on a separate test show that OSC
was successful: the prediction errors are lower for the OSC corrected
models and data.

### Requirements for running osccalc

- MATLAB 5.0
- PLS_Toolbox or other PLS code

### Developed by:

Barry M. Wise

Eigenvector Research, Inc.

bmw@eigenvector.com

### Download osccalc.m

To get it, simply click on osccalc.m
for Mac, or osccalc.m for
PC. Move the file to a folder on your MATLAB path and you're
done.

Return
to MATLAB User Area.