ApplyModel
Location: ..\cubatch\Common\ApplyModel.m

function Pred = ApplyModel (PredFun,X,Y,Model_Parameters,Pred,InitialSize,FillInMode,PreProcess,varargin);
Description:
Applies a model, as defined within Model_Parameters, to a new set of data, represented by X (and Y when necessary).
In order to allow "on-line" applications, 'filling in' is also supported, according to Nomikos and Mc. Gregor
Inputs:
PredFun: function computing the prediction for the desired model. It can be a string (for MatLab© 5.3 or superior) or a function handle (for MatLab© 6.x or superior)
X: double array with the new data
Y: double array with the Y data (in case an additional array is needed - see Instrumental Variables Models)
Model_Parameters: model's parameters as required by PredFun (i.e. as a structure ModelOut.model)
PredIn: structure where to save the results (i.e. structure ModelOut.prediction)
InitialSize: size of the batch before the filling-in (stored in ModelOut.info.initialsize)
FillInMode: fill-in mode in case the model can be applied "on-line" (i.e. the last mode has been given name 'time' - case insensitive) and the length of the new "batch" is not identical to the NOC batches. It can either be 'Current deviation' or 'Zero'
PreProcess: PreProcess: Stores the preprocessing information for the model of reference.
It contains two fields: 'modx' (for X) and 'mody' (for Y). Each of them has two fields: 'cen' and 'scal', which are row vectors of the same length as the original X and Y and refer to centre and scaling.
1 means centre/scale according to mean and standard deviation.
The 'scal' values can also be 2 (scaling with Root Mean Squares) or 3 (scaling with Frobenius norm) .
varargin: additional inputs as (and if) required by PredFun
Outputs:
PredOut: structure (ModelOut.prediction) holding the results for the new set of data.
Called by:
PARAFACApply, nPLS1Apply
Subroutines:
Internal: Names and hyperlinks
External: Nway\nprocess

Author:
Giorgio Tomasi
Royal Agricultural and Veterinary University
MLI, LMT, Chemometrics group
Rolighedsvej 30
DK-1958 Frederiksberg C
Danmark
Last modified: 26-Oct-2002 23:07:10
Contact: Giorgio Tomasi, gt@kvl.dk
References
[1] Nomikos P., Mac Gregor J.F., "Monitoring batch process using multiway principal component analysis", AIChE journal, Vol 40, n°8, 1994, 1361-1373