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)).
| #include <nag.h> |
| #include <nagg02.h> |
| 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) |
|
The parameter estimates
for a
-factor orthogonal scores PLS model with
predictor variables and
response variables are given by,
where
is the
by
(
) matrix of
-weights;
is the
by
matrix of
-loadings; and
is the
by
matrix of
-loadings for a fitted PLS model.
Optionally, nag_pls_orth_scores_fit (g02lcc) will calculate variable influence on projection (VIP) statistics, see
Wold (1994).
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
- 1:
order – Nag_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
. See
Section 3.2.1.3 in the Essential Introduction for a more detailed explanation of the use of this argument.
Constraint:
or Nag_ColMajor.
- 2:
ip – IntegerInput
-
On entry:
, the number of predictor variables in the fitted model.
Constraint:
.
- 3:
my – IntegerInput
-
On entry:
, the number of response variables.
Constraint:
.
- 4:
maxfac – IntegerInput
-
On entry:
, the number of factors available in the PLS model.
Constraint:
.
- 5:
nfact – IntegerInput
-
On entry: , the number of factors to include in the calculation of parameter estimates.
Constraint:
.
- 6:
p[] – const doubleInput
-
Note: the dimension,
dim, of the array
p
must be at least
- when ;
- when .
The
th element of the matrix
is stored in
- when ;
- when .
- 7:
pdp – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
p.
Constraints:
- if ,
;
- if , .
- 8:
c[] – const doubleInput
-
Note: the dimension,
dim, of the array
c
must be at least
- when ;
- when .
The
th element of the matrix
is stored in
- when ;
- when .
- 9:
pdc – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
c.
Constraints:
- if ,
;
- if , .
- 10:
w[] – const doubleInput
-
Note: the dimension,
dim, of the array
w
must be at least
- when ;
- when .
The
th element of the matrix
is stored in
- when ;
- when .
- 11:
pdw – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
w.
Constraints:
- if ,
;
- if , .
- 12:
rcond – doubleInput
-
On entry: singular values of
less than
rcond times the maximum singular value are treated as zero when calculating parameter estimates. If
rcond is negative, a value of
is used.
- 13:
b[] – doubleOutput
-
Note: the dimension,
dim, of the array
b
must be at least
- when ;
- when .
Where
appears in this document, it refers to the array element
- when ;
- when .
On exit: contains the parameter estimate for the th predictor variable in the model for the th response variable, for and .
- 14:
pdb – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
b.
Constraints:
- if ,
;
- if , .
- 15:
orig – Nag_EstimatesOptionInput
-
On entry: indicates how parameter estimates are calculated.
- Parameter estimates for the centered, and possibly, scaled data.
- Parameter estimates for the original data.
Constraint:
or .
- 16:
xbar[ip] – const doubleInput
-
On entry: if
, mean values of predictor variables in the model; otherwise
xbar is not referenced.
- 17:
ybar[my] – const doubleInput
-
On entry: if
, mean value of each response variable in the model; otherwise
ybar is not referenced.
- 18:
iscale – Nag_ScalePredictorInput
-
On entry: if
,
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 , , or .
- 19:
xstd[ip] – const doubleInput
-
On entry: if
and
, 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
and
, 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[] – doubleOutput
-
Note: the dimension,
dim, of the array
ob
must be at least
- when
and
;
- when
and
;
- otherwise.
Where
appears in this document, it refers to the array element
- when ;
- when .
On exit: if
,
contains the intercept value for the
th response variable, and
contains the parameter estimate on the original scale for the
th predictor variable in the model, for
and
. Otherwise
ob is not referenced.
- 22:
pdob – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
ob.
Constraints:
- if ,
- if , ;
- otherwise ;
- if ,
- if ,
;
- otherwise .
- 23:
vipopt – IntegerInput
-
On entry: a flag that determines variable influence on projections (VIP) options.
- VIP are not calculated.
- VIP are calculated for predictor variables using the mean explained variance in responses.
- VIP are calculated for predictor variables for each response variable in the model.
Note that setting when gives the same result as setting directly.
Constraint:
, , or .
- 24:
ycv[] – const doubleInput
-
Note: the dimension,
dim, of the array
ycv
must be at least
- when
and
;
- when
and
.
Where
appears in this document, it refers to the array element
- when ;
- when .
On entry: if
,
is the cumulative percentage of variance of the
th response variable explained by the first
factors, for
and
; otherwise
ycv is not referenced.
- 25:
pdycv – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
ycv.
Constraints:
- if , if , ;
- if ,
- 26:
vip[] – doubleOutput
-
Note: the dimension,
dim, of the array
vip
must be at least
- when ;
- when and .
Where
appears in this document, it refers to the array element
- when ;
- when .
On exit: if
,
contains the VIP statistic for the
th predictor variable in the model for all response variables, for
.
If , contains the VIP statistic for the th predictor variable in the model for the th response variable, for and .
Otherwise
vip is not referenced.
- 27:
pdvip – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
vip.
Constraints:
- if , if , ;
- if , .
- 28:
fail – NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
- NE_ALLOC_FAIL
Dynamic memory allocation failed.
- NE_BAD_PARAM
On entry, argument had an illegal value.
- NE_ENUM_INT
On entry, .
Constraint: if , or .
- NE_INT
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INT_2
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: if , .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: if , .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: if , .
On entry, and .
Constraint: .
On entry, and .
Constraint: , , or .
- NE_INT_3
On entry, , and .
Constraint: if ,
.
- 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.
This example reads in details of a PLS model, and a set of parameter estimates are calculated along with their VIP statistics.