g02lb fits an orthogonal scores partial least squares (PLS) regression by using Wold's iterative method.
Syntax
C# |
---|
public static void g02lb( int n, int mx, double[,] x, int[] isx, int ip, int my, double[,] y, double[] xbar, double[] ybar, int iscale, double[] xstd, double[] ystd, int maxfac, int maxit, double tau, double[,] xres, double[,] yres, double[,] w, double[,] p, double[,] t, double[,] c, double[,] u, double[] xcv, double[,] ycv, out int ifail ) |
Visual Basic |
---|
Public Shared Sub g02lb ( _ n As Integer, _ mx As Integer, _ x As Double(,), _ isx As Integer(), _ ip As Integer, _ my As Integer, _ y As Double(,), _ xbar As Double(), _ ybar As Double(), _ iscale As Integer, _ xstd As Double(), _ ystd As Double(), _ maxfac As Integer, _ maxit As Integer, _ tau As Double, _ xres As Double(,), _ yres As Double(,), _ w As Double(,), _ p As Double(,), _ t As Double(,), _ c As Double(,), _ u As Double(,), _ xcv As Double(), _ ycv As Double(,), _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void g02lb( int n, int mx, array<double,2>^ x, array<int>^ isx, int ip, int my, array<double,2>^ y, array<double>^ xbar, array<double>^ ybar, int iscale, array<double>^ xstd, array<double>^ ystd, int maxfac, int maxit, double tau, array<double,2>^ xres, array<double,2>^ yres, array<double,2>^ w, array<double,2>^ p, array<double,2>^ t, array<double,2>^ c, array<double,2>^ u, array<double>^ xcv, array<double,2>^ ycv, [OutAttribute] int% ifail ) |
F# |
---|
static member g02lb : n : int * mx : int * x : float[,] * isx : int[] * ip : int * my : int * y : float[,] * xbar : float[] * ybar : float[] * iscale : int * xstd : float[] * ystd : float[] * maxfac : int * maxit : int * tau : float * xres : float[,] * yres : float[,] * w : float[,] * p : float[,] * t : float[,] * c : float[,] * u : float[,] * xcv : float[] * ycv : float[,] * ifail : int byref -> unit |
Parameters
- n
- Type: System..::..Int32On entry: , the number of observations.Constraint: .
- mx
- Type: System..::..Int32On entry: the number of predictor variables.Constraint: .
- x
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, mx]Note: dim1 must satisfy the constraint:On entry: must contain the th observation on the th predictor variable, for and .
- isx
- Type: array<System..::..Int32>[]()[][]An array of size [mx]On entry: indicates which predictor variables are to be included in the model.
- The th predictor variable (with variates in the th column of ) is included in the model.
- Otherwise.
- ip
- Type: System..::..Int32On entry: , the number of predictor variables in the model.Constraint: .
- my
- Type: System..::..Int32On entry: , the number of response variables.Constraint: .
- y
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, my]Note: dim1 must satisfy the constraint:On entry: must contain the th observation for the th response variable, for and .
- xbar
- Type: array<System..::..Double>[]()[][]An array of size [ip]On exit: mean values of predictor variables in the model.
- ybar
- Type: array<System..::..Double>[]()[][]An array of size [my]On exit: the mean value of each response variable.
- iscale
- Type: System..::..Int32On entry: indicates how predictor variables are scaled.
- Data are scaled by the standard deviation of variables.
- Data are scaled by user-supplied scalings.
- No scaling.
Constraint: , or .
- xstd
- Type: array<System..::..Double>[]()[][]An array of size [ip]On entry: if , must contain the user-supplied scaling for the th predictor variable in the model, for . Otherwise xstd need not be set.On exit: if , standard deviations of predictor variables in the model. Otherwise xstd is not changed.
- ystd
- Type: array<System..::..Double>[]()[][]An array of size [my]On entry: if , must contain the user-supplied scaling for the th response variable in the model, for . Otherwise ystd need not be set.On exit: if , the standard deviation of each response variable. Otherwise ystd is not changed.
- maxfac
- Type: System..::..Int32On entry: , the number of latent variables to calculate.Constraint: .
- maxit
- Type: System..::..Int32On entry: if , maxit is not referenced; otherwise the maximum number of iterations used to calculate the -weights.Suggested value: .Constraint: if , .
- tau
- Type: System..::..DoubleOn entry: if , tau is not referenced; otherwise the iterative procedure used to calculate the -weights will halt if the Euclidean distance between two subsequent estimates is less than or equal to tau.Suggested value: .Constraint: if , .
- xres
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, ip]Note: dim1 must satisfy the constraint:On exit: the predictor variables' residual matrix .
- yres
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, my]Note: dim1 must satisfy the constraint:On exit: the residuals for each response variable, .
- w
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, maxfac]Note: dim1 must satisfy the constraint:On exit: the th column of contains the -weights , for .
- p
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, maxfac]Note: dim1 must satisfy the constraint:On exit: the th column of contains the -loadings , for .
- t
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, maxfac]Note: dim1 must satisfy the constraint:On exit: the th column of contains the -scores , for .
- c
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, maxfac]Note: dim1 must satisfy the constraint:On exit: the th column of contains the -loadings , for .
- u
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, maxfac]Note: dim1 must satisfy the constraint:On exit: the th column of contains the -scores , for .
- xcv
- Type: array<System..::..Double>[]()[][]An array of size [maxfac]On exit: contains the cumulative percentage of variance in the predictor variables explained by the first factors, for .
- ycv
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, my]Note: dim1 must satisfy the constraint:On exit: is the cumulative percentage of variance of the th response variable explained by the first factors, for and .
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
Let be the mean-centred by data matrix of observations on predictor variables. Let be the mean-centred by data matrix of observations on response variables.
The first of the factors PLS methods extract from the data predicts both and by regressing on a column vector of scores:
where the column vectors of -loadings and -loadings are calculated in the least squares sense:
The -score vector is the linear combination of predictor data that has maximum covariance with the -scores , where the -weights vector is the normalised first left singular vector of .
The method extracts subsequent PLS factors by repeating the above process with the residual matrices:
and with orthogonal scores:
Optionally, in addition to being mean-centred, the data matrices and may be scaled by standard deviations of the variables. If data are supplied mean-centred, the calculations are not affected within numerical accuracy.
References
Wold H (1966) Estimation of principal components and related models by iterative least squares In: Multivariate Analysis (ed P R Krishnaiah) 391–420 Academic Press NY
Error Indicators and Warnings
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface
(LDX, LDY, LDXRES, LDYRES, LDW, LDP, LDT, LDC, LDU, LDYCV) In these
cases, an error in another parameter has usually caused an incorrect value to be inferred.
On entry, , or , or an element of or , or , or , or .
On entry, or , or or , or and , or and ,
Accuracy
In general, the iterative method used in the calculations is less accurate (but faster) than the singular value decomposition approach adopted by g02la.
Parallelism and Performance
None.
Further Comments
g02lb allocates internally () elements of real storage.
Example
This example reads in data from an experiment to measure the biological activity in a chemical compound, and a PLS model is estimated.
Example program (C#): g02lbe.cs