Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

Chapter Contents
Chapter Introduction
NAG Toolbox

# NAG Toolbox: nag_correg_pls_wold (g02lb)

## Purpose

nag_correg_pls_wold (g02lb) fits an orthogonal scores partial least squares (PLS) regression by using Wold's iterative method.

## Syntax

[xbar, ybar, xstd, ystd, xres, yres, w, p, t, c, u, xcv, ycv, ifail] = g02lb(x, isx, y, iscale, xstd, ystd, maxfac, 'n', n, 'mx', mx, 'ip', ip, 'my', my, 'maxit', maxit, 'tau', tau)
[xbar, ybar, xstd, ystd, xres, yres, w, p, t, c, u, xcv, ycv, ifail] = nag_correg_pls_wold(x, isx, y, iscale, xstd, ystd, maxfac, 'n', n, 'mx', mx, 'ip', ip, 'my', my, 'maxit', maxit, 'tau', tau)
Note: the interface to this routine has changed since earlier releases of the toolbox:
Mark 24: tau, maxit optional
.

## Description

Let X1${X}_{1}$ be the mean-centred n$n$ by m$m$ data matrix X$X$ of n$n$ observations on m$m$ predictor variables. Let Y1${Y}_{1}$ be the mean-centred n$n$ by r$r$ data matrix Y$Y$ of n$n$ observations on r$r$ response variables.
The first of the k$k$ factors PLS methods extract from the data predicts both X1${X}_{1}$ and Y1${Y}_{1}$ by regressing on a t1${t}_{1}$ column vector of n$n$ scores:
 X̂1 = t1 p1T Ŷ1 = t1 c1T , with ​ t1T t1 = 1 ,
$X^1 = t1 p1T Y^1 = t1 c1T , with ​ t1T t1 = 1 ,$
where the column vectors of m$m$ x$x$-loadings p1${p}_{1}$ and r$r$ y$y$-loadings c1${c}_{1}$ are calculated in the least squares sense:
 p1T = t1T X1 c1T = t1T Y1 .
$p1T = t1T X1 c1T = t1T Y1 .$
The x$x$-score vector t1 = X1w1${t}_{1}={X}_{1}{w}_{1}$ is the linear combination of predictor data X1${X}_{1}$ that has maximum covariance with the y$y$-scores u1 = Y1c1${u}_{1}={Y}_{1}{c}_{1}$, where the x$x$-weights vector w1${w}_{1}$ is the normalised first left singular vector of X1T Y1${X}_{1}^{\mathrm{T}}{Y}_{1}$.
The method extracts subsequent PLS factors by repeating the above process with the residual matrices:
 Xi = Xi − 1 − X̂i − 1 Yi = Yi − 1 − Ŷi − 1 ,   i = 2,3, … ,k ,
$Xi = Xi-1 - X^ i-1 Yi = Yi-1 - Y^ i-1 , i=2,3,…,k ,$
and with orthogonal scores:
 tiT tj = 0 ,   j = 1,2, … ,i − 1 . $tiT tj = 0 , j=1,2,…,i-1 .$
Optionally, in addition to being mean-centred, the data matrices X1${X}_{1}$ and Y1${Y}_{1}$ 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

## Parameters

### Compulsory Input Parameters

1:     x(ldx,mx) – double array
ldx, the first dimension of the array, must satisfy the constraint ldxn$\mathit{ldx}\ge {\mathbf{n}}$.
x(i,j)${\mathbf{x}}\left(\mathit{i},\mathit{j}\right)$ must contain the i$\mathit{i}$th observation on the j$\mathit{j}$th predictor variable, for i = 1,2,,n$\mathit{i}=1,2,\dots ,{\mathbf{n}}$ and j = 1,2,,mx$\mathit{j}=1,2,\dots ,{\mathbf{mx}}$.
2:     isx(mx) – int64int32nag_int array
mx, the dimension of the array, must satisfy the constraint mx > 1${\mathbf{mx}}>1$.
Indicates which predictor variables are to be included in the model.
isx(j) = 1${\mathbf{isx}}\left(j\right)=1$
The j$j$th predictor variable (with variates in the j$j$th column of X$X$) is included in the model.
isx(j) = 0${\mathbf{isx}}\left(j\right)=0$
Otherwise.
Constraint: the sum of elements in isx must equal ip.
3:     y(ldy,my) – double array
ldy, the first dimension of the array, must satisfy the constraint ldyn$\mathit{ldy}\ge {\mathbf{n}}$.
y(i,j)${\mathbf{y}}\left(\mathit{i},\mathit{j}\right)$ must contain the i$\mathit{i}$th observation for the j$\mathit{j}$th response variable, for i = 1,2,,n$\mathit{i}=1,2,\dots ,{\mathbf{n}}$ and j = 1,2,,my$\mathit{j}=1,2,\dots ,{\mathbf{my}}$.
4:     iscale – int64int32nag_int scalar
Indicates how predictor variables are scaled.
iscale = 1${\mathbf{iscale}}=1$
Data are scaled by the standard deviation of variables.
iscale = 2${\mathbf{iscale}}=2$
Data are scaled by user-supplied scalings.
iscale = -1${\mathbf{iscale}}=-1$
No scaling.
Constraint: iscale = -1${\mathbf{iscale}}=-1$, 1$1$ or 2$2$.
5:     xstd(ip) – double array
ip, the dimension of the array, must satisfy the constraint 1 < ipmx$1<{\mathbf{ip}}\le {\mathbf{mx}}$.
If iscale = 2${\mathbf{iscale}}=2$, xstd(j)${\mathbf{xstd}}\left(\mathit{j}\right)$ must contain the user-supplied scaling for the j$\mathit{j}$th predictor variable in the model, for j = 1,2,,ip$\mathit{j}=1,2,\dots ,{\mathbf{ip}}$. Otherwise xstd need not be set.
6:     ystd(my) – double array
my, the dimension of the array, must satisfy the constraint my1${\mathbf{my}}\ge 1$.
If iscale = 2${\mathbf{iscale}}=2$, ystd(j)${\mathbf{ystd}}\left(\mathit{j}\right)$ must contain the user-supplied scaling for the j$\mathit{j}$th response variable in the model, for j = 1,2,,my$\mathit{j}=1,2,\dots ,{\mathbf{my}}$. Otherwise ystd need not be set.
7:     maxfac – int64int32nag_int scalar
k$k$, the number of latent variables to calculate.
Constraint: 1maxfacip$1\le {\mathbf{maxfac}}\le {\mathbf{ip}}$.

### Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The first dimension of the arrays x, y. (An error is raised if these dimensions are not equal.)
n$n$, the number of observations.
Constraint: n > 1${\mathbf{n}}>1$.
2:     mx – int64int32nag_int scalar
Default: The dimension of the array isx and the second dimension of the array x. (An error is raised if these dimensions are not equal.)
The number of predictor variables.
Constraint: mx > 1${\mathbf{mx}}>1$.
3:     ip – int64int32nag_int scalar
Default: The dimension of the array xstd.
m$m$, the number of predictor variables in the model.
Constraint: 1 < ipmx$1<{\mathbf{ip}}\le {\mathbf{mx}}$.
4:     my – int64int32nag_int scalar
Default: The dimension of the array ystd and the second dimension of the array y. (An error is raised if these dimensions are not equal.)
r$r$, the number of response variables.
Constraint: my1${\mathbf{my}}\ge 1$.
5:     maxit – int64int32nag_int scalar
If my = 1${\mathbf{my}}=1$, maxit is not referenced; otherwise the maximum number of iterations used to calculate the x$x$-weights.
Default: maxit = 200${\mathbf{maxit}}=200$
Constraint: if my > 1${\mathbf{my}}>1$, maxit > 1${\mathbf{maxit}}>1$.
6:     tau – double scalar
If my = 1${\mathbf{my}}=1$, tau is not referenced; otherwise the iterative procedure used to calculate the x$x$-weights will halt if the Euclidean distance between two subsequent estimates is less than or equal to tau.
Default: tau = 1.0e−4${\mathbf{tau}}=\text{1.0e−4}$
Constraint: if my > 1${\mathbf{my}}>1$, tau > 0.0${\mathbf{tau}}>0.0$.

### Input Parameters Omitted from the MATLAB Interface

ldx ldy ldxres ldyres ldw ldp ldt ldc ldu ldycv

### Output Parameters

1:     xbar(ip) – double array
Mean values of predictor variables in the model.
2:     ybar(my) – double array
The mean value of each response variable.
3:     xstd(ip) – double array
If iscale = 1${\mathbf{iscale}}=1$, standard deviations of predictor variables in the model. Otherwise xstd is not changed.
4:     ystd(my) – double array
If iscale = 1${\mathbf{iscale}}=1$, the standard deviation of each response variable. Otherwise ystd is not changed.
5:     xres(ldxres,ip) – double array
ldxresn$\mathit{ldxres}\ge {\mathbf{n}}$.
The predictor variables' residual matrix Xk${X}_{k}$.
6:     yres(ldyres,my) – double array
ldyresn$\mathit{ldyres}\ge {\mathbf{n}}$.
The residuals for each response variable, Yk${Y}_{k}$.
7:     w(ldw,maxfac) – double array
ldwip$\mathit{ldw}\ge {\mathbf{ip}}$.
The j$\mathit{j}$th column of W$W$ contains the x$x$-weights wj${w}_{\mathit{j}}$, for j = 1,2,,maxfac$\mathit{j}=1,2,\dots ,{\mathbf{maxfac}}$.
8:     p(ldp,maxfac) – double array
ldpip$\mathit{ldp}\ge {\mathbf{ip}}$.
The j$\mathit{j}$th column of P$P$ contains the x$x$-loadings pj${p}_{\mathit{j}}$, for j = 1,2,,maxfac$\mathit{j}=1,2,\dots ,{\mathbf{maxfac}}$.
9:     t(ldt,maxfac) – double array
ldtn$\mathit{ldt}\ge {\mathbf{n}}$.
The j$\mathit{j}$th column of T$T$ contains the x$x$-scores tj${t}_{\mathit{j}}$, for j = 1,2,,maxfac$\mathit{j}=1,2,\dots ,{\mathbf{maxfac}}$.
10:   c(ldc,maxfac) – double array
ldcmy$\mathit{ldc}\ge {\mathbf{my}}$.
The j$\mathit{j}$th column of C$C$ contains the y$y$-loadings cj${c}_{\mathit{j}}$, for j = 1,2,,maxfac$\mathit{j}=1,2,\dots ,{\mathbf{maxfac}}$.
11:   u(ldu,maxfac) – double array
ldun$\mathit{ldu}\ge {\mathbf{n}}$.
The j$\mathit{j}$th column of U$U$ contains the y$y$-scores uj${u}_{\mathit{j}}$, for j = 1,2,,maxfac$\mathit{j}=1,2,\dots ,{\mathbf{maxfac}}$.
12:   xcv(maxfac) – double array
xcv(j)${\mathbf{xcv}}\left(\mathit{j}\right)$ contains the cumulative percentage of variance in the predictor variables explained by the first j$\mathit{j}$ factors, for j = 1,2,,maxfac$\mathit{j}=1,2,\dots ,{\mathbf{maxfac}}$.
13:   ycv(ldycv,my) – double array
ldycvmaxfac$\mathit{ldycv}\ge {\mathbf{maxfac}}$.
ycv(i,j)${\mathbf{ycv}}\left(\mathit{i},\mathit{j}\right)$ is the cumulative percentage of variance of the j$\mathit{j}$th response variable explained by the first i$\mathit{i}$ factors, for i = 1,2,,maxfac$\mathit{i}=1,2,\dots ,{\mathbf{maxfac}}$ and j = 1,2,,my$\mathit{j}=1,2,\dots ,{\mathbf{my}}$.
14:   ifail – int64int32nag_int scalar
${\mathrm{ifail}}={\mathbf{0}}$ unless the function detects an error (see [Error Indicators and Warnings]).

## Error Indicators and Warnings

Errors or warnings detected by the function:
ifail = 1${\mathbf{ifail}}=1$
 On entry, n < 2${\mathbf{n}}<2$, or mx < 2${\mathbf{mx}}<2$, or an element of isx ≠ 0${\mathbf{isx}}\ne 0$ or 1$1$, or my < 1${\mathbf{my}}<1$, or iscale ≠ -1${\mathbf{iscale}}\ne -1$, 1$1$ or 2$2$.
ifail = 2${\mathbf{ifail}}=2$
 On entry, ldx < n$\mathit{ldx}<{\mathbf{n}}$, or ip < 2${\mathbf{ip}}<2$ or ip > mx${\mathbf{ip}}>{\mathbf{mx}}$, or ldy < n$\mathit{ldy}<{\mathbf{n}}$, or maxfac < 1${\mathbf{maxfac}}<1$ or ${\mathbf{maxfac}}>{\mathbf{ip}}$, or my > 1${\mathbf{my}}>1$ and maxit ≤ 1${\mathbf{maxit}}\le 1$, or my > 1${\mathbf{my}}>1$ and tau ≤ 0.0${\mathbf{tau}}\le 0.0$, or ldxres < n$\mathit{ldxres}<{\mathbf{n}}$, or ldyres < n$\mathit{ldyres}<{\mathbf{n}}$, or ldw < ip$\mathit{ldw}<{\mathbf{ip}}$, or ldp < ip$\mathit{ldp}<{\mathbf{ip}}$, or ldc < my$\mathit{ldc}<{\mathbf{my}}$, or ldt < n$\mathit{ldt}<{\mathbf{n}}$, or ldu < n$\mathit{ldu}<{\mathbf{n}}$, or ldycv < maxfac$\mathit{ldycv}<{\mathbf{maxfac}}$.
ifail = 3${\mathbf{ifail}}=3$
ip does not equal the sum of elements in isx.

## Accuracy

In general, the iterative method used in the calculations is less accurate (but faster) than the singular value decomposition approach adopted by nag_correg_pls_svd (g02la).

nag_correg_pls_wold (g02lb) allocates internally (n + r$n+r$) elements of double storage.

## Example

```function nag_correg_pls_wold_example
x = [-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 1.9607, -1.6324, ...
0.5746, 1.9607, -1.6324, 0.574, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 1.9607, -1.6324, ...
0.5746, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333, ...
0.0902, 1.9607, -1.6324, 0.5746, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333, ...
0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 2.8369, 1.4092, -3.1398, 0.0744, -1.7333, ...
0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, -4.7548, 3.6521, ...
0.8524, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333, ...
0.0902, 0.0744, -1.7333, 0.0902, -1.2201, 0.8829, 2.2253;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 2.4064, 1.7438, ...
1.1057, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 0.0744, -1.7333, 0.0902, 0.0744, -1.7333, ...
0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
2.2261, -5.3648, 0.3049, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333, ...
0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-4.1921, -1.0285, -0.9801, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333, ...
0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-4.9217, 1.2977, 0.4473, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333, ...
0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 2.2261, -5.3648, ...
0.3049, 2.2261, -5.3648, 0.3049, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, -4.9217, 1.2977, ...
0.4473, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, -4.1921, -1.0285, ...
-0.9801, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398];
isx = ones(15, 1, 'int64');
y = [0;0.28;0.2;0.51;0.11;2.73;0.18;1.53;-0.1;-0.52;0.4;0.3;-1;1.57;0.59];
iscale = int64(1);
xstd = zeros(15, 1);
ystd = [0];
maxfac = int64(4);
[xbar, ybar, xstdOut, ystdOut, xres, yres, w, p, t, c, u, xcv, ycv, ifail] = ...
nag_correg_pls_wold(x, isx, y, iscale, xstd, ystd, maxfac)
```
```

xbar =

-2.6137
-2.3614
-1.0449
2.8614
0.3156
-0.2641
-0.3146
-1.1221
0.2401
0.4694
-1.9619
0.1691
2.5664
1.3741
-2.7821

ybar =

0.4520

xstdOut =

1.4956
1.3233
0.5829
0.7735
0.6247
0.7966
2.4113
2.0421
0.4678
0.8197
0.9420
0.1735
1.0475
0.1359
1.3853

ystdOut =

0.9062

xres =

Columns 1 through 9

0.5270   -0.3689    0.3559   -0.4126   -0.5572    0.4198   -0.2773    0.2477   -0.0704
0.1973   -0.3392   -0.3323    0.0646   -0.2604    0.6403    0.5212   -0.2744    0.5535
0.3314   -0.2623    0.1522   -0.2158   -0.3327    0.3034   -0.7904    0.2199   -0.8792
0.0014   -0.2325   -0.5365    0.2618   -0.0356    0.5239    0.0088   -0.3024   -0.2548
0.0294   -0.4945   -1.0686   -0.0484    1.2332   -2.5880   -0.4220   -0.0115    0.0186
0.3074   -0.1970    0.2558   -0.0378    0.2148   -0.5015   -0.0146    0.1862    0.2950
-0.2382    0.3952    0.3257    0.5963    0.7523   -0.4992   -0.1086   -0.0605   -0.0371
0.4495   -0.3948    0.1230   -0.1885   -0.2942    0.2724    1.4126    0.4280    1.0781
-0.6352    0.1862   -1.0409   -2.9900   -2.6946    0.3145    0.4281    0.1827    0.5372
2.5029   -2.0193    1.2074    1.0321    0.6477    0.4653    0.2246    0.5833    0.8890
-0.9517    0.8371   -0.0396    0.2151   -0.1179    0.6105    0.0327   -0.3922   -0.3070
-1.7120    2.6260    1.8591    0.4847    0.0285    0.7783    0.1958   -0.1668    0.1312
-0.5133    0.4067   -0.2509    0.4074    0.6723   -0.6626    0.3226   -0.2405    0.3010
0.1209   -0.1562   -0.0813    0.1489    0.2406   -0.2318   -0.5985   -0.2699   -0.1218
-0.4166    0.0136   -0.9291    0.6822    0.5033    0.1549   -0.9350   -0.1297   -2.1334

Columns 10 through 15

0.3304    0.6297    0.6994    0.1694    0.1694   -0.1694
-0.4342   -0.3245   -0.6752    0.2816    0.2816   -0.2816
0.5204    0.8023    1.0133    0.1221    0.1221   -0.1221
-0.2433   -0.1521   -0.3638    0.2343    0.2343   -0.2343
0.0245   -0.6582   -0.2927   -0.4687   -0.4687    0.4687
0.1176    0.0341    0.1566   -0.1477   -0.1477    0.1477
-0.0019   -0.2597   -0.1292   -0.3225   -0.3225    0.3225
-0.4030   -0.3317   -0.6416    0.0873    0.0873   -0.0873
0.0951    0.4746    0.3451    0.6324    0.6324   -0.6324
0.1566    0.5175    0.4393    0.0685    0.0685   -0.0685
-0.2088   -0.2336   -0.3626    0.0384    0.0384   -0.0384
0.0648   -0.0903    0.0329   -0.4937   -0.4937    0.4937
-0.3409   -0.7200   -0.7578   -0.2528   -0.2528    0.2528
0.0951    0.0428    0.1340   -0.0127   -0.0127    0.0127
0.2275    0.2691    0.4022    0.0640    0.0640   -0.0640

yres =

-0.1254
-0.1776
0.1312
0.1119
0.0637
0.1753
0.0335
0.1365
-0.0169
-0.0214
-0.1004
0.0689
0.0095
-0.3242
0.0355

w =

-0.1576   -0.1594    0.1777    0.0540
0.0857   -0.0002   -0.1218    0.1099
-0.1693   -0.3743    0.0943    0.3188
0.1215    0.2059   -0.1814   -0.0446
0.0711    0.0559   -0.2692    0.0549
0.0652    0.2417    0.2336   -0.1885
-0.4248   -0.0019   -0.3241   -0.1160
0.6537    0.1672    0.2191    0.2546
0.2850    0.3655   -0.1924   -0.1543
-0.2934    0.5046   -0.0110    0.1388
0.2983   -0.3698   -0.4994   -0.4936
-0.2031    0.4195   -0.2568   -0.0756
0.0569   -0.0232   -0.3050    0.3967
0.0569   -0.0232   -0.3050    0.3967
-0.0569    0.0232    0.3050   -0.3967

p =

-0.6708   -1.0047    0.6505    0.6169
0.4943    0.1355   -0.9010   -0.2388
-0.4167   -1.9983   -0.5538    0.8474
0.3930    1.2441   -0.6967   -0.4336
0.3267    0.5838   -1.4088   -0.6323
0.0145    0.9607    1.6594    0.5361
-2.4471    0.3532   -1.1321   -1.3554
3.5198    0.6005    0.2191    0.0380
1.0973    2.0635   -0.4074   -0.3522
-2.4466    2.5640   -0.4806    0.3819
2.2732   -1.3110   -0.7686   -1.8959
-1.7987    2.4088   -0.9475   -0.4727
0.3629    0.2241   -2.6332    2.3739
0.3629    0.2241   -2.6332    2.3739
-0.3629   -0.2241    2.6332   -2.3739

t =

-0.1896    0.3898   -0.2502   -0.2479
0.0201   -0.0013   -0.1726   -0.2042
-0.1889    0.3141   -0.1727   -0.1350
0.0210   -0.0773   -0.0950   -0.0912
-0.0090   -0.2649   -0.4195   -0.1327
0.5479    0.2843    0.1914    0.2727
-0.0937   -0.0579    0.6799   -0.6129
0.2500    0.2033   -0.1046   -0.1014
-0.1005   -0.2992    0.2131    0.1223
-0.1810   -0.4427    0.0559    0.2114
0.0497   -0.0762   -0.1526   -0.0771
0.0173   -0.2517   -0.2104    0.1044
-0.6002    0.3596    0.1876    0.4812
0.3796    0.1338    0.1410    0.1999
0.0773   -0.2139    0.1085    0.2106

c =

3.5425    1.0475    0.2548    0.1866

u =

-1.7670    0.1812   -0.0600   -0.0320
-0.6724   -0.2735   -0.0662   -0.0402
-0.9852    0.4097    0.0158    0.0198
0.2267   -0.0107    0.0180    0.0177
-1.3370   -0.3619   -0.0173    0.0073
8.9056    0.6000    0.0701    0.0422
-1.0634    0.0332    0.0235   -0.0151
4.2143    0.3184    0.0232    0.0219
-2.1580   -0.2652    0.0153    0.0011
-3.7999   -0.4520    0.0082    0.0034
-0.2033   -0.2446   -0.0392   -0.0214
-0.5942   -0.2398    0.0089    0.0165
-5.6764    0.5487    0.0375    0.0185
4.3707   -0.1161   -0.0639   -0.0535
0.5395   -0.1274    0.0261    0.0139

xcv =

16.9021
29.6743
44.3324
56.1720

ycv =

89.6381
97.4763
97.9398
98.1885

ifail =

0

```
```function g02lb_example
x = [-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 1.9607, -1.6324, ...
0.5746, 1.9607, -1.6324, 0.574, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 1.9607, -1.6324, ...
0.5746, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333, ...
0.0902, 1.9607, -1.6324, 0.5746, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333, ...
0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 2.8369, 1.4092, -3.1398, 0.0744, -1.7333, ...
0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, -4.7548, 3.6521, ...
0.8524, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333, ...
0.0902, 0.0744, -1.7333, 0.0902, -1.2201, 0.8829, 2.2253;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 2.4064, 1.7438, ...
1.1057, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 0.0744, -1.7333, 0.0902, 0.0744, -1.7333, ...
0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
2.2261, -5.3648, 0.3049, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333, ...
0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-4.1921, -1.0285, -0.9801, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333, ...
0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-4.9217, 1.2977, 0.4473, 3.0777, 0.3891, -0.0701, 0.0744, -1.7333, ...
0.0902, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, 2.2261, -5.3648, ...
0.3049, 2.2261, -5.3648, 0.3049, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, -4.9217, 1.2977, ...
0.4473, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398;
-2.6931, -2.5271, -1.2871, 3.0777, 0.3891, -0.0701, -4.1921, -1.0285, ...
-0.9801, 0.0744, -1.7333, 0.0902, 2.8369, 1.4092, -3.1398];
isx = ones(15, 1, 'int64');
y = [0;0.28;0.2;0.51;0.11;2.73;0.18;1.53;-0.1;-0.52;0.4;0.3;-1;1.57;0.59];
iscale = int64(1);
xstd = zeros(15, 1);
ystd = [0];
maxfac = int64(4);
[xbar, ybar, xstdOut, ystdOut, xres, yres, w, p, t, c, u, xcv, ycv, ifail] = ...
g02lb(x, isx, y, iscale, xstd, ystd, maxfac)
```
```

xbar =

-2.6137
-2.3614
-1.0449
2.8614
0.3156
-0.2641
-0.3146
-1.1221
0.2401
0.4694
-1.9619
0.1691
2.5664
1.3741
-2.7821

ybar =

0.4520

xstdOut =

1.4956
1.3233
0.5829
0.7735
0.6247
0.7966
2.4113
2.0421
0.4678
0.8197
0.9420
0.1735
1.0475
0.1359
1.3853

ystdOut =

0.9062

xres =

Columns 1 through 9

0.5270   -0.3689    0.3559   -0.4126   -0.5572    0.4198   -0.2773    0.2477   -0.0704
0.1973   -0.3392   -0.3323    0.0646   -0.2604    0.6403    0.5212   -0.2744    0.5535
0.3314   -0.2623    0.1522   -0.2158   -0.3327    0.3034   -0.7904    0.2199   -0.8792
0.0014   -0.2325   -0.5365    0.2618   -0.0356    0.5239    0.0088   -0.3024   -0.2548
0.0294   -0.4945   -1.0686   -0.0484    1.2332   -2.5880   -0.4220   -0.0115    0.0186
0.3074   -0.1970    0.2558   -0.0378    0.2148   -0.5015   -0.0146    0.1862    0.2950
-0.2382    0.3952    0.3257    0.5963    0.7523   -0.4992   -0.1086   -0.0605   -0.0371
0.4495   -0.3948    0.1230   -0.1885   -0.2942    0.2724    1.4126    0.4280    1.0781
-0.6352    0.1862   -1.0409   -2.9900   -2.6946    0.3145    0.4281    0.1827    0.5372
2.5029   -2.0193    1.2074    1.0321    0.6477    0.4653    0.2246    0.5833    0.8890
-0.9517    0.8371   -0.0396    0.2151   -0.1179    0.6105    0.0327   -0.3922   -0.3070
-1.7120    2.6260    1.8591    0.4847    0.0285    0.7783    0.1958   -0.1668    0.1312
-0.5133    0.4067   -0.2509    0.4074    0.6723   -0.6626    0.3226   -0.2405    0.3010
0.1209   -0.1562   -0.0813    0.1489    0.2406   -0.2318   -0.5985   -0.2699   -0.1218
-0.4166    0.0136   -0.9291    0.6822    0.5033    0.1549   -0.9350   -0.1297   -2.1334

Columns 10 through 15

0.3304    0.6297    0.6994    0.1694    0.1694   -0.1694
-0.4342   -0.3245   -0.6752    0.2816    0.2816   -0.2816
0.5204    0.8023    1.0133    0.1221    0.1221   -0.1221
-0.2433   -0.1521   -0.3638    0.2343    0.2343   -0.2343
0.0245   -0.6582   -0.2927   -0.4687   -0.4687    0.4687
0.1176    0.0341    0.1566   -0.1477   -0.1477    0.1477
-0.0019   -0.2597   -0.1292   -0.3225   -0.3225    0.3225
-0.4030   -0.3317   -0.6416    0.0873    0.0873   -0.0873
0.0951    0.4746    0.3451    0.6324    0.6324   -0.6324
0.1566    0.5175    0.4393    0.0685    0.0685   -0.0685
-0.2088   -0.2336   -0.3626    0.0384    0.0384   -0.0384
0.0648   -0.0903    0.0329   -0.4937   -0.4937    0.4937
-0.3409   -0.7200   -0.7578   -0.2528   -0.2528    0.2528
0.0951    0.0428    0.1340   -0.0127   -0.0127    0.0127
0.2275    0.2691    0.4022    0.0640    0.0640   -0.0640

yres =

-0.1254
-0.1776
0.1312
0.1119
0.0637
0.1753
0.0335
0.1365
-0.0169
-0.0214
-0.1004
0.0689
0.0095
-0.3242
0.0355

w =

-0.1576   -0.1594    0.1777    0.0540
0.0857   -0.0002   -0.1218    0.1099
-0.1693   -0.3743    0.0943    0.3188
0.1215    0.2059   -0.1814   -0.0446
0.0711    0.0559   -0.2692    0.0549
0.0652    0.2417    0.2336   -0.1885
-0.4248   -0.0019   -0.3241   -0.1160
0.6537    0.1672    0.2191    0.2546
0.2850    0.3655   -0.1924   -0.1543
-0.2934    0.5046   -0.0110    0.1388
0.2983   -0.3698   -0.4994   -0.4936
-0.2031    0.4195   -0.2568   -0.0756
0.0569   -0.0232   -0.3050    0.3967
0.0569   -0.0232   -0.3050    0.3967
-0.0569    0.0232    0.3050   -0.3967

p =

-0.6708   -1.0047    0.6505    0.6169
0.4943    0.1355   -0.9010   -0.2388
-0.4167   -1.9983   -0.5538    0.8474
0.3930    1.2441   -0.6967   -0.4336
0.3267    0.5838   -1.4088   -0.6323
0.0145    0.9607    1.6594    0.5361
-2.4471    0.3532   -1.1321   -1.3554
3.5198    0.6005    0.2191    0.0380
1.0973    2.0635   -0.4074   -0.3522
-2.4466    2.5640   -0.4806    0.3819
2.2732   -1.3110   -0.7686   -1.8959
-1.7987    2.4088   -0.9475   -0.4727
0.3629    0.2241   -2.6332    2.3739
0.3629    0.2241   -2.6332    2.3739
-0.3629   -0.2241    2.6332   -2.3739

t =

-0.1896    0.3898   -0.2502   -0.2479
0.0201   -0.0013   -0.1726   -0.2042
-0.1889    0.3141   -0.1727   -0.1350
0.0210   -0.0773   -0.0950   -0.0912
-0.0090   -0.2649   -0.4195   -0.1327
0.5479    0.2843    0.1914    0.2727
-0.0937   -0.0579    0.6799   -0.6129
0.2500    0.2033   -0.1046   -0.1014
-0.1005   -0.2992    0.2131    0.1223
-0.1810   -0.4427    0.0559    0.2114
0.0497   -0.0762   -0.1526   -0.0771
0.0173   -0.2517   -0.2104    0.1044
-0.6002    0.3596    0.1876    0.4812
0.3796    0.1338    0.1410    0.1999
0.0773   -0.2139    0.1085    0.2106

c =

3.5425    1.0475    0.2548    0.1866

u =

-1.7670    0.1812   -0.0600   -0.0320
-0.6724   -0.2735   -0.0662   -0.0402
-0.9852    0.4097    0.0158    0.0198
0.2267   -0.0107    0.0180    0.0177
-1.3370   -0.3619   -0.0173    0.0073
8.9056    0.6000    0.0701    0.0422
-1.0634    0.0332    0.0235   -0.0151
4.2143    0.3184    0.0232    0.0219
-2.1580   -0.2652    0.0153    0.0011
-3.7999   -0.4520    0.0082    0.0034
-0.2033   -0.2446   -0.0392   -0.0214
-0.5942   -0.2398    0.0089    0.0165
-5.6764    0.5487    0.0375    0.0185
4.3707   -0.1161   -0.0639   -0.0535
0.5395   -0.1274    0.0261    0.0139

xcv =

16.9021
29.6743
44.3324
56.1720

ycv =

89.6381
97.4763
97.9398
98.1885

ifail =

0

```