# Difference between revisions of "Plsrsgcv"

imported>Jeremy (Importing text file) |
imported>Jeremy |
||

(2 intermediate revisions by 2 users not shown) | |||

Line 1: | Line 1: | ||

− | |||

===Purpose=== | ===Purpose=== | ||

− | Generates a | + | Generates a PLS model for MSPC with cross-validation. |

===Synopsis=== | ===Synopsis=== | ||

Line 10: | Line 9: | ||

===Description=== | ===Description=== | ||

− | + | This function constructs a matrix of PLS models that can be used like a PCA model for multivariate statistical process control (MSPC) purposes. Given a data matrix <tt>data</tt>, a PLS model is formed using a maximum of <tt>lv</tt> latent variables that relates each variable to all of the other variables. The PLS model regression vectors are collected in an output matrix <tt>coeff</tt>, which can be used like the <tt>I=PP'</tt> matrix in PCA. | |

+ | |||

+ | Multiplying a new data matrix by the matrix <tt>coeff</tt> yields a matrix whose values are the difference between the new data and it's prediction based on the PLS regressions created by <tt>plsrsgncv</tt>. | ||

+ | |||

+ | '''Warning''': This function can take a long time to execute if you choose to do many cross-validations! Execution can be sped up by setting optional variable out=0. | ||

+ | |||

+ | ====Inputs==== | ||

+ | |||

+ | * '''data''' = input data matrix | ||

+ | * '''lv''' = maximum number of latent variables to consider | ||

+ | * '''cvit''' = the number of cross-validation test sets | ||

+ | * '''cvnum''' = the number of samples in each cross validation test set | ||

+ | |||

+ | ====Optional Inputs==== | ||

+ | |||

+ | * '''out''' = allows the user to suppress intermediate output [out=0 suppresses output] | ||

+ | |||

+ | ====Outputs==== | ||

+ | |||

+ | * '''coeff''' = matrix of PLS regression coefficients | ||

===See Also=== | ===See Also=== | ||

[[plsrsgn]], [[replace]] | [[plsrsgn]], [[replace]] |

## Latest revision as of 14:44, 10 October 2008

### Purpose

Generates a PLS model for MSPC with cross-validation.

### Synopsis

- coeff = plsrsgcv(data,lv,cvit,cvnum,out)

### Description

This function constructs a matrix of PLS models that can be used like a PCA model for multivariate statistical process control (MSPC) purposes. Given a data matrix `data`, a PLS model is formed using a maximum of `lv` latent variables that relates each variable to all of the other variables. The PLS model regression vectors are collected in an output matrix `coeff`, which can be used like the `I=PP'` matrix in PCA.

Multiplying a new data matrix by the matrix `coeff` yields a matrix whose values are the difference between the new data and it's prediction based on the PLS regressions created by `plsrsgncv`.

**Warning**: This function can take a long time to execute if you choose to do many cross-validations! Execution can be sped up by setting optional variable out=0.

#### Inputs

**data**= input data matrix**lv**= maximum number of latent variables to consider**cvit**= the number of cross-validation test sets**cvnum**= the number of samples in each cross validation test set

#### Optional Inputs

**out**= allows the user to suppress intermediate output [out=0 suppresses output]

#### Outputs

**coeff**= matrix of PLS regression coefficients