g02 Chapter Contents
g02 Chapter Introduction
NAG C Library Manual

# NAG Library Function Documentnag_pls_orth_scores_fit (g02lcc)

## 1  Purpose

nag_pls_orth_scores_fit (g02lcc) calculates parameter estimates for a given number of factors given the output from an orthogonal scores PLS regression (nag_pls_orth_scores_svd (g02lac) or nag_pls_orth_scores_wold (g02lbc)).

## 2  Specification

 #include #include
 void nag_pls_orth_scores_fit (Nag_OrderType order, Integer ip, Integer my, Integer maxfac, Integer nfact, const double p[], Integer pdp, const double c[], Integer pdc, const double w[], Integer pdw, double rcond, double b[], Integer pdb, Nag_EstimatesOption orig, const double xbar[], const double ybar[], Nag_ScalePredictor iscale, const double xstd[], const double ystd[], double ob[], Integer pdob, Integer vipopt, const double ycv[], Integer pdycv, double vip[], Integer pdvip, NagError *fail)

## 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$ ($\ge 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 ${X}_{1}$ and response data ${Y}_{1}$. Parameter estimates may also be given for the predictor data $X$ and response data $Y$.
Optionally, nag_pls_orth_scores_fit (g02lcc) 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:     orderNag_OrderTypeInput
On entry: the order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by ${\mathbf{order}}=\mathrm{Nag_RowMajor}$. See Section 3.2.1.3 in the Essential Introduction for a more detailed explanation of the use of this argument.
Constraint: ${\mathbf{order}}=\mathrm{Nag_RowMajor}$ or Nag_ColMajor.
2:     ipIntegerInput
On entry: $m$, the number of predictor variables in the fitted model.
Constraint: ${\mathbf{ip}}>1$.
3:     myIntegerInput
On entry: $r$, the number of response variables.
Constraint: ${\mathbf{my}}\ge 1$.
4:     maxfacIntegerInput
On entry: $k$, the number of factors available in the PLS model.
Constraint: $1\le {\mathbf{maxfac}}\le {\mathbf{ip}}$.
5:     nfactIntegerInput
On entry: $l$, the number of factors to include in the calculation of parameter estimates.
Constraint: $1\le {\mathbf{nfact}}\le {\mathbf{maxfac}}$.
6:     p[$\mathit{dim}$]const doubleInput
Note: the dimension, dim, of the array p must be at least
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{pdp}}×{\mathbf{maxfac}}\right)$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{ip}}×{\mathbf{pdp}}\right)$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
The $\left(i,j\right)$th element of the matrix $P$ is stored in
• ${\mathbf{p}}\left[\left(j-1\right)×{\mathbf{pdp}}+i-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• ${\mathbf{p}}\left[\left(i-1\right)×{\mathbf{pdp}}+j-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
On entry: $x$-loadings as returned from nag_pls_orth_scores_svd (g02lac) and nag_pls_orth_scores_wold (g02lbc).
7:     pdpIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array p.
Constraints:
• if ${\mathbf{order}}=\mathrm{Nag_ColMajor}$, ${\mathbf{pdp}}\ge {\mathbf{ip}}$;
• if ${\mathbf{order}}=\mathrm{Nag_RowMajor}$, ${\mathbf{pdp}}\ge {\mathbf{maxfac}}$.
8:     c[$\mathit{dim}$]const doubleInput
Note: the dimension, dim, of the array c must be at least
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{pdc}}×{\mathbf{maxfac}}\right)$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{my}}×{\mathbf{pdc}}\right)$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
The $\left(i,j\right)$th element of the matrix $C$ is stored in
• ${\mathbf{c}}\left[\left(j-1\right)×{\mathbf{pdc}}+i-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• ${\mathbf{c}}\left[\left(i-1\right)×{\mathbf{pdc}}+j-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
On entry: $y$-loadings as returned from nag_pls_orth_scores_svd (g02lac) and nag_pls_orth_scores_wold (g02lbc).
9:     pdcIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array c.
Constraints:
• if ${\mathbf{order}}=\mathrm{Nag_ColMajor}$, ${\mathbf{pdc}}\ge {\mathbf{my}}$;
• if ${\mathbf{order}}=\mathrm{Nag_RowMajor}$, ${\mathbf{pdc}}\ge {\mathbf{maxfac}}$.
10:   w[$\mathit{dim}$]const doubleInput
Note: the dimension, dim, of the array w must be at least
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{pdw}}×{\mathbf{maxfac}}\right)$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{ip}}×{\mathbf{pdw}}\right)$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
The $\left(i,j\right)$th element of the matrix $W$ is stored in
• ${\mathbf{w}}\left[\left(j-1\right)×{\mathbf{pdw}}+i-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• ${\mathbf{w}}\left[\left(i-1\right)×{\mathbf{pdw}}+j-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
On entry: $x$-weights as returned from nag_pls_orth_scores_svd (g02lac) and nag_pls_orth_scores_wold (g02lbc).
11:   pdwIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array w.
Constraints:
• if ${\mathbf{order}}=\mathrm{Nag_ColMajor}$, ${\mathbf{pdw}}\ge {\mathbf{ip}}$;
• if ${\mathbf{order}}=\mathrm{Nag_RowMajor}$, ${\mathbf{pdw}}\ge {\mathbf{maxfac}}$.
12:   rconddoubleInput
On entry: singular values of ${P}^{\mathrm{T}}W$ 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.
13:   b[$\mathit{dim}$]doubleOutput
Note: the dimension, dim, of the array b must be at least
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{pdb}}×{\mathbf{my}}\right)$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{ip}}×{\mathbf{pdb}}\right)$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
Where ${\mathbf{B}}\left(i,j\right)$ appears in this document, it refers to the array element
• ${\mathbf{b}}\left[\left(j-1\right)×{\mathbf{pdb}}+i-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• ${\mathbf{b}}\left[\left(i-1\right)×{\mathbf{pdb}}+j-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
On exit: ${\mathbf{B}}\left(\mathit{i},\mathit{j}\right)$ contains the parameter estimate for the $\mathit{i}$th predictor variable in the model for the $\mathit{j}$th response variable, for $\mathit{i}=1,2,\dots ,{\mathbf{ip}}$ and $\mathit{j}=1,2,\dots ,{\mathbf{my}}$.
14:   pdbIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array b.
Constraints:
• if ${\mathbf{order}}=\mathrm{Nag_ColMajor}$, ${\mathbf{pdb}}\ge {\mathbf{ip}}$;
• if ${\mathbf{order}}=\mathrm{Nag_RowMajor}$, ${\mathbf{pdb}}\ge {\mathbf{my}}$.
15:   origNag_EstimatesOptionInput
On entry: indicates how parameter estimates are calculated.
${\mathbf{orig}}=\mathrm{Nag_EstimatesStand}$
Parameter estimates for the centered, and possibly, scaled data.
${\mathbf{orig}}=\mathrm{Nag_EstimatesOrig}$
Parameter estimates for the original data.
Constraint: ${\mathbf{orig}}=\mathrm{Nag_EstimatesStand}$ or $\mathrm{Nag_EstimatesOrig}$.
16:   xbar[ip]const doubleInput
On entry: if ${\mathbf{orig}}=\mathrm{Nag_EstimatesOrig}$, mean values of predictor variables in the model; otherwise xbar is not referenced.
17:   ybar[my]const doubleInput
On entry: if ${\mathbf{orig}}=\mathrm{Nag_EstimatesOrig}$, mean value of each response variable in the model; otherwise ybar is not referenced.
18:   iscaleNag_ScalePredictorInput
On entry: if ${\mathbf{orig}}=\mathrm{Nag_EstimatesOrig}$, iscale must take the value supplied to either nag_pls_orth_scores_svd (g02lac) or nag_pls_orth_scores_wold (g02lbc); otherwise iscale is not referenced.
Constraint: if ${\mathbf{orig}}=\mathrm{Nag_EstimatesOrig}$, ${\mathbf{iscale}}=\mathrm{Nag_PredNoScale}$, $\mathrm{Nag_PredStdScale}$ or $\mathrm{Nag_PredUserScale}$.
19:   xstd[ip]const doubleInput
On entry: if ${\mathbf{orig}}=\mathrm{Nag_EstimatesOrig}$ and ${\mathbf{iscale}}\ne \mathrm{Nag_PredNoScale}$, the scalings of predictor variables in the model as returned from either nag_pls_orth_scores_svd (g02lac) or nag_pls_orth_scores_wold (g02lbc); otherwise xstd is not referenced.
20:   ystd[my]const doubleInput
On entry: if ${\mathbf{orig}}=\mathrm{Nag_EstimatesOrig}$ and ${\mathbf{iscale}}\ne \mathrm{Nag_PredNoScale}$, the scalings of response variables as returned from either nag_pls_orth_scores_svd (g02lac) or nag_pls_orth_scores_wold (g02lbc); otherwise ystd is not referenced.
21:   ob[$\mathit{dim}$]doubleOutput
Note: the dimension, dim, of the array ob must be at least
• ${\mathbf{pdob}}×{\mathbf{my}}$ when ${\mathbf{orig}}=\mathrm{Nag_EstimatesOrig}$ and ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,\left({\mathbf{ip}}+1\right)×{\mathbf{pdob}}\right)$ when ${\mathbf{orig}}=\mathrm{Nag_EstimatesOrig}$ and ${\mathbf{order}}=\mathrm{Nag_RowMajor}$;
• $1$ otherwise.
Where ${\mathbf{OB}}\left(i,j\right)$ appears in this document, it refers to the array element
• ${\mathbf{ob}}\left[\left(j-1\right)×{\mathbf{pdob}}+i-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• ${\mathbf{ob}}\left[\left(i-1\right)×{\mathbf{pdob}}+j-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
On exit: if ${\mathbf{orig}}=\mathrm{Nag_EstimatesOrig}$, ${\mathbf{OB}}\left(1,\mathit{j}\right)$ contains the intercept value for the $\mathit{j}$th response variable, and ${\mathbf{OB}}\left(\mathit{i}+1,\mathit{j}\right)$ contains the parameter estimate on the original scale for the $\mathit{i}$th predictor variable in the model, for $\mathit{i}=1,2,\dots ,{\mathbf{ip}}$ and $\mathit{j}=1,2,\dots ,{\mathbf{my}}$. Otherwise ob is not referenced.
22:   pdobIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array ob.
Constraints:
• if ${\mathbf{order}}=\mathrm{Nag_ColMajor}$,
• if ${\mathbf{orig}}=\mathrm{Nag_EstimatesOrig}$, ${\mathbf{pdob}}\ge {\mathbf{ip}}+1$;
• otherwise ${\mathbf{pdob}}\ge 1$;
• if ${\mathbf{order}}=\mathrm{Nag_RowMajor}$,
• if ${\mathbf{orig}}=\mathrm{Nag_EstimatesOrig}$, ${\mathbf{pdob}}\ge {\mathbf{my}}$;
• otherwise ${\mathbf{pdob}}\ge 1$.
23:   vipoptIntegerInput
On entry: a flag that determines variable influence on projections (VIP) options.
${\mathbf{vipopt}}=0$
VIP are not calculated.
${\mathbf{vipopt}}=1$
VIP are calculated for predictor variables using the mean explained variance in responses.
${\mathbf{vipopt}}={\mathbf{my}}$
VIP are calculated for predictor variables for each response variable in the model.
Note that setting ${\mathbf{vipopt}}={\mathbf{my}}$ when ${\mathbf{my}}=1$ gives the same result as setting ${\mathbf{vipopt}}=1$ directly.
Constraint: ${\mathbf{vipopt}}=0$, $1$,  or ${\mathbf{my}}$.
24:   ycv[$\mathit{dim}$]const doubleInput
Note: the dimension, dim, of the array ycv must be at least
• ${\mathbf{pdycv}}×{\mathbf{my}}$ when ${\mathbf{vipopt}}\ne 0$ and ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{nfact}}×{\mathbf{pdycv}}\right)$ when ${\mathbf{vipopt}}\ne 0$ and ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
Where ${\mathbf{YCV}}\left(i,j\right)$ appears in this document, it refers to the array element
• ${\mathbf{ycv}}\left[\left(j-1\right)×{\mathbf{pdycv}}+i-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• ${\mathbf{ycv}}\left[\left(i-1\right)×{\mathbf{pdycv}}+j-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
On entry: if ${\mathbf{vipopt}}\ne 0$, ${\mathbf{YCV}}\left(\mathit{i},\mathit{j}\right)$ is the cumulative percentage of variance of the $\mathit{j}$th response variable explained by the first $\mathit{i}$ factors, for $\mathit{i}=1,2,\dots ,{\mathbf{nfact}}$ and $\mathit{j}=1,2,\dots ,{\mathbf{my}}$; otherwise ycv is not referenced.
25:   pdycvIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array ycv.
Constraints:
• if ${\mathbf{order}}=\mathrm{Nag_ColMajor}$, if ${\mathbf{vipopt}}\ne 0$, ${\mathbf{pdycv}}\ge {\mathbf{nfact}}$;
• if ${\mathbf{order}}=\mathrm{Nag_RowMajor}$,
• if ${\mathbf{vipopt}}\ne 0$, ${\mathbf{pdycv}}\ge {\mathbf{my}}$.
26:   vip[$\mathit{dim}$]doubleOutput
Note: the dimension, dim, of the array vip must be at least
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{pdvip}}×{\mathbf{vipopt}}\right)$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{ip}}×{\mathbf{pdvip}}\right)$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$ and ${\mathbf{vipopt}}\ne 0$.
Where ${\mathbf{VIP}}\left(i,j\right)$ appears in this document, it refers to the array element
• ${\mathbf{vip}}\left[\left(j-1\right)×{\mathbf{pdvip}}+i-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• ${\mathbf{vip}}\left[\left(i-1\right)×{\mathbf{pdvip}}+j-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
On exit: if ${\mathbf{vipopt}}=1$, ${\mathbf{VIP}}\left(\mathit{i},1\right)$ contains the VIP statistic for the $\mathit{i}$th predictor variable in the model for all response variables, for $\mathit{i}=1,2,\dots ,{\mathbf{ip}}$.
If ${\mathbf{vipopt}}={\mathbf{my}}$, ${\mathbf{VIP}}\left(\mathit{i},\mathit{j}\right)$ contains the VIP statistic for the $\mathit{i}$th predictor variable in the model for the $\mathit{j}$th response variable, for $\mathit{i}=1,2,\dots ,{\mathbf{ip}}$ and $\mathit{j}=1,2,\dots ,{\mathbf{my}}$.
Otherwise vip is not referenced.
27:   pdvipIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array vip.
Constraints:
• if ${\mathbf{order}}=\mathrm{Nag_ColMajor}$, if ${\mathbf{vipopt}}\ne 0$, ${\mathbf{pdvip}}\ge {\mathbf{ip}}$;
• if ${\mathbf{order}}=\mathrm{Nag_RowMajor}$, ${\mathbf{pdvip}}\ge {\mathbf{vipopt}}$.
28:   failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

## 6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
On entry, argument $〈\mathit{\text{value}}〉$ had an illegal value.
NE_ENUM_INT
On entry, ${\mathbf{iscale}}=〈\mathit{\text{value}}〉$.
Constraint: if ${\mathbf{orig}}=\mathrm{Nag_EstimatesOrig}$, ${\mathbf{iscale}}=\mathrm{Nag_PredNoScale}$ or $\mathrm{Nag_PredStdScale}$.
NE_INT
On entry, ${\mathbf{ip}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{ip}}>1$.
On entry, ${\mathbf{my}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{my}}\ge 1$.
On entry, ${\mathbf{pdb}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdb}}>0$.
On entry, ${\mathbf{pdc}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdc}}>0$.
On entry, ${\mathbf{pdob}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdob}}>0$.
On entry, ${\mathbf{pdp}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdp}}>0$.
On entry, ${\mathbf{pdvip}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdvip}}>0$.
On entry, ${\mathbf{pdw}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdw}}>0$.
On entry, ${\mathbf{pdycv}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdycv}}>0$.
NE_INT_2
On entry, ${\mathbf{maxfac}}=〈\mathit{\text{value}}〉$ and ${\mathbf{ip}}=〈\mathit{\text{value}}〉$.
Constraint: $1\le {\mathbf{maxfac}}\le {\mathbf{ip}}$.
On entry, ${\mathbf{nfact}}=〈\mathit{\text{value}}〉$ and ${\mathbf{maxfac}}=〈\mathit{\text{value}}〉$.
Constraint: $1\le {\mathbf{nfact}}\le {\mathbf{maxfac}}$.
On entry, ${\mathbf{pdb}}=〈\mathit{\text{value}}〉$ and ${\mathbf{ip}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdb}}\ge {\mathbf{ip}}$.
On entry, ${\mathbf{pdb}}=〈\mathit{\text{value}}〉$ and ${\mathbf{my}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdb}}\ge {\mathbf{my}}$.
On entry, ${\mathbf{pdc}}=〈\mathit{\text{value}}〉$ and ${\mathbf{maxfac}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdc}}\ge {\mathbf{maxfac}}$.
On entry, ${\mathbf{pdc}}=〈\mathit{\text{value}}〉$ and ${\mathbf{my}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdc}}\ge {\mathbf{my}}$.
On entry, ${\mathbf{pdob}}=〈\mathit{\text{value}}〉$ and ${\mathbf{ip}}=〈\mathit{\text{value}}〉$.
Constraint: if ${\mathbf{orig}}=\mathrm{Nag_EstimatesOrig}$, ${\mathbf{pdob}}\ge {\mathbf{ip}}+1$.
On entry, ${\mathbf{pdp}}=〈\mathit{\text{value}}〉$ and ${\mathbf{ip}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdp}}\ge {\mathbf{ip}}$.
On entry, ${\mathbf{pdp}}=〈\mathit{\text{value}}〉$ and ${\mathbf{maxfac}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdp}}\ge {\mathbf{maxfac}}$.
On entry, ${\mathbf{pdvip}}=〈\mathit{\text{value}}〉$ and ${\mathbf{ip}}=〈\mathit{\text{value}}〉$.
Constraint: if ${\mathbf{vipopt}}\ne 0$, ${\mathbf{pdvip}}\ge {\mathbf{ip}}$.
On entry, ${\mathbf{pdvip}}=〈\mathit{\text{value}}〉$ and ${\mathbf{vipopt}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdvip}}\ge {\mathbf{vipopt}}$.
On entry, ${\mathbf{pdw}}=〈\mathit{\text{value}}〉$ and ${\mathbf{ip}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdw}}\ge {\mathbf{ip}}$.
On entry, ${\mathbf{pdw}}=〈\mathit{\text{value}}〉$ and ${\mathbf{maxfac}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pdw}}\ge {\mathbf{maxfac}}$.
On entry, ${\mathbf{pdycv}}=〈\mathit{\text{value}}〉$ and ${\mathbf{nfact}}=〈\mathit{\text{value}}〉$.
Constraint: if ${\mathbf{vipopt}}\ne 0$, ${\mathbf{pdycv}}\ge {\mathbf{nfact}}$.
On entry, ${\mathbf{vipopt}}=〈\mathit{\text{value}}〉$ and ${\mathbf{my}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{my}}>0$.
On entry, ${\mathbf{vipopt}}=〈\mathit{\text{value}}〉$ and ${\mathbf{my}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{vipopt}}=0$, $1$,  or ${\mathbf{my}}$.
NE_INT_3
On entry, ${\mathbf{pdycv}}=〈\mathit{\text{value}}〉$, ${\mathbf{vipopt}}=〈\mathit{\text{value}}〉$ and ${\mathbf{my}}=〈\mathit{\text{value}}〉$.
Constraint: if ${\mathbf{vipopt}}\ne 0$, ${\mathbf{pdycv}}\ge {\mathbf{my}}$.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.

## 7  Accuracy

The calculations are based on the singular value decomposition of ${P}^{\mathrm{T}}W$.

nag_pls_orth_scores_fit (g02lcc) allocates internally $l\left(l+r+4\right)+\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(2l,r\right)$ elements of double storage.

## 9  Example

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

### 9.1  Program Text

Program Text (g02lcce.c)

### 9.2  Program Data

Program Data (g02lcce.d)

### 9.3  Program Results

Program Results (g02lcce.r)