G02LCF (PDF version)
G02 Chapter Contents
G02 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

G02LCF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

 Contents

    1  Purpose
    7  Accuracy

1  Purpose

G02LCF calculates parameter estimates for a given number of factors given the output from an orthogonal scores PLS regression (G02LAF or G02LBF).

2  Specification

SUBROUTINE G02LCF ( IP, MY, MAXFAC, NFACT, P, LDP, C, LDC, W, LDW, RCOND, B, LDB, ORIG, XBAR, YBAR, ISCALE, XSTD, YSTD, OB, LDOB, VIPOPT, YCV, LDYCV, VIP, LDVIP, IFAIL)
INTEGER  IP, MY, MAXFAC, NFACT, LDP, LDC, LDW, LDB, ORIG, ISCALE, LDOB, VIPOPT, LDYCV, LDVIP, IFAIL
REAL (KIND=nag_wp)  P(LDP,MAXFAC), C(LDC,MAXFAC), W(LDW,MAXFAC), RCOND, B(LDB,MY), XBAR(IP), YBAR(MY), XSTD(IP), YSTD(MY), OB(LDOB,MY), YCV(LDYCV,MY), VIP(LDVIP,VIPOPT)

3  Description

The parameter estimates B for a l-factor orthogonal scores PLS model with m predictor variables and r response variables are given by,
B=W PTW-1 CT , B m×r ,  
where W is the m by k (l) matrix of x-weights; P is the m by k matrix of x-loadings; and C is the r by k matrix of y-loadings for a fitted PLS model.
The parameter estimates B are for centred, and possibly scaled, predictor data X1 and response data Y1. Parameter estimates may also be given for the predictor data X and response data Y.
Optionally, G02LCF will calculate variable influence on projection (VIP) statistics, see Wold (1994).

4  References

Wold S (1994) PLS for multivariate linear modelling QSAR: chemometric methods in molecular design Methods and Principles in Medicinal Chemistry (ed van de Waterbeemd H) Verlag-Chemie

5  Arguments

1:     IP – INTEGERInput
On entry: m, the number of predictor variables in the fitted model.
Constraint: IP>1.
2:     MY – INTEGERInput
On entry: r, the number of response variables.
Constraint: MY1.
3:     MAXFAC – INTEGERInput
On entry: k, the number of factors available in the PLS model.
Constraint: 1MAXFACIP.
4:     NFACT – INTEGERInput
On entry: l, the number of factors to include in the calculation of parameter estimates.
Constraint: 1NFACTMAXFAC.
5:     PLDPMAXFAC – REAL (KIND=nag_wp) arrayInput
On entry: x-loadings as returned from G02LAF and G02LBF.
6:     LDP – INTEGERInput
On entry: the first dimension of the array P as declared in the (sub)program from which G02LCF is called.
Constraint: LDPIP.
7:     CLDCMAXFAC – REAL (KIND=nag_wp) arrayInput
On entry: y-loadings as returned from G02LAF and G02LBF.
8:     LDC – INTEGERInput
On entry: the first dimension of the array C as declared in the (sub)program from which G02LCF is called.
Constraint: LDCMY.
9:     WLDWMAXFAC – REAL (KIND=nag_wp) arrayInput
On entry: x-weights as returned from G02LAF and G02LBF.
10:   LDW – INTEGERInput
On entry: the first dimension of the array W as declared in the (sub)program from which G02LCF is called.
Constraint: LDWIP.
11:   RCOND – REAL (KIND=nag_wp)Input
On entry: singular values of PTW less than RCOND times the maximum singular value are treated as zero when calculating parameter estimates. If RCOND is negative, a value of 0.005 is used.
12:   BLDBMY – REAL (KIND=nag_wp) arrayOutput
On exit: Bij contains the parameter estimate for the ith predictor variable in the model for the jth response variable, for i=1,2,,IP and j=1,2,,MY.
13:   LDB – INTEGERInput
On entry: the first dimension of the array B as declared in the (sub)program from which G02LCF is called.
Constraint: LDBIP.
14:   ORIG – INTEGERInput
On entry: indicates how parameter estimates are calculated.
ORIG=-1
Parameter estimates for the centred, and possibly, scaled data.
ORIG=1
Parameter estimates for the original data.
Constraint: ORIG=-1 or 1.
15:   XBARIP – REAL (KIND=nag_wp) arrayInput
On entry: if ORIG=1, mean values of predictor variables in the model; otherwise XBAR is not referenced.
16:   YBARMY – REAL (KIND=nag_wp) arrayInput
On entry: if ORIG=1, mean value of each response variable in the model; otherwise YBAR is not referenced.
17:   ISCALE – INTEGERInput
On entry: if ORIG=1, ISCALE must take the value supplied to either G02LAF or G02LBF; otherwise ISCALE is not referenced.
Constraint: if ORIG=1, ISCALE=-1, 1 or 2.
18:   XSTDIP – REAL (KIND=nag_wp) arrayInput
On entry: if ORIG=1 and ISCALE-1, the scalings of predictor variables in the model as returned from either G02LAF or G02LBF; otherwise XSTD is not referenced.
19:   YSTDMY – REAL (KIND=nag_wp) arrayInput
On entry: if ORIG=1 and ISCALE-1, the scalings of response variables as returned from either G02LAF or G02LBF; otherwise YSTD is not referenced.
20:   OBLDOBMY – REAL (KIND=nag_wp) arrayOutput
On exit: if ORIG=1, OB1j contains the intercept value for the jth response variable, and OBi+1j contains the parameter estimate on the original scale for the ith predictor variable in the model, for i=1,2,,IP and j=1,2,,MY. Otherwise OB is not referenced.
21:   LDOB – INTEGERInput
On entry: the first dimension of the array OB as declared in the (sub)program from which G02LCF is called.
Constraints:
  • if ORIG=1, LDOBIP+1;
  • otherwise LDOB1.
22:   VIPOPT – INTEGERInput
On entry: a flag that determines variable influence on projections (VIP) options.
VIPOPT=0
VIP are not calculated.
VIPOPT=1
VIP are calculated for predictor variables using the mean explained variance in responses.
VIPOPT=MY
VIP are calculated for predictor variables for each response variable in the model.
Note that setting VIPOPT=MY when MY=1 gives the same result as setting VIPOPT=1 directly.
Constraint: VIPOPT=0, 1 or MY.
23:   YCVLDYCVMY – REAL (KIND=nag_wp) arrayInput
On entry: if VIPOPT0, YCVij is the cumulative percentage of variance of the jth response variable explained by the first i factors, for i=1,2,,NFACT and j=1,2,,MY; otherwise YCV is not referenced.
24:   LDYCV – INTEGERInput
On entry: the first dimension of the array YCV as declared in the (sub)program from which G02LCF is called.
Constraint: if VIPOPT0, LDYCVNFACT.
25:   VIPLDVIPVIPOPT – REAL (KIND=nag_wp) arrayOutput
On exit: if VIPOPT=1, VIPi1 contains the VIP statistic for the ith predictor variable in the model for all response variables, for i=1,2,,IP.
If VIPOPT=MY, VIPij contains the VIP statistic for the ith predictor variable in the model for the jth response variable, for i=1,2,,IP and j=1,2,,MY.
Otherwise VIP is not referenced.
26:   LDVIP – INTEGERInput
On entry: the first dimension of the array VIP as declared in the (sub)program from which G02LCF is called.
Constraint: if VIPOPT0, LDVIPIP.
27:   IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this argument, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
IFAIL=1
On entry, IP=value.
Constraint: IP>1.
On entry, ISCALE=value.
Constraint: if ORIG=1, ISCALE=-1 or 1.
On entry, MY=value.
Constraint: MY1.
On entry, ORIG=value.
Constraint: ORIG=-1 or 1.
On entry, VIPOPT=value and MY=value.
Constraint: VIPOPT=0, 1 or MY.
IFAIL=2
On entry, LDB=value and IP=value.
Constraint: LDBIP.
On entry, LDC=value and MY=value.
Constraint: LDCMY.
On entry, LDOB=value and IP=value.
Constraint: if ORIG=1, LDOBIP+1.
On entry, LDP=value and IP=value.
Constraint: LDPIP.
On entry, LDVIP=value and IP=value.
Constraint: if VIPOPT0, LDVIPIP.
On entry, LDW=value and IP=value.
Constraint: LDWIP.
On entry, LDYCV=value and NFACT=value.
Constraint: if VIPOPT0, LDYCVNFACT.
On entry, MAXFAC=value and IP=value.
Constraint: 1MAXFACIP.
On entry, NFACT=value and MAXFAC=value.
Constraint: 1NFACTMAXFAC.
IFAIL=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
IFAIL=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
IFAIL=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

7  Accuracy

The calculations are based on the singular value decomposition of PTW.

8  Parallelism and Performance

G02LCF is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
G02LCF makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9  Further Comments

G02LCF allocates internally ll+r+4+max2l,r elements of real storage.

10  Example

This example reads in details of a PLS model, and a set of parameter estimates are calculated along with their VIP statistics.

10.1  Program Text

Program Text (g02lcfe.f90)

10.2  Program Data

Program Data (g02lcfe.d)

10.3  Program Results

Program Results (g02lcfe.r)


G02LCF (PDF version)
G02 Chapter Contents
G02 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2016