﻿PLS1NipalsAlgorithm Class

# PLS1NipalsAlgorithm Class

Class PLS1NipalsAlgorithm encapsulates the Nonlinear Iterative PArtial Least Squares (NIPALS) algorithm for computing partial least squares regression components.
Inheritance Hierarchy
SystemObject
CenterSpace.NMath.CoreIPLS1Calc
CenterSpace.NMath.CorePLS1NipalsAlgorithm

Namespace:  CenterSpace.NMath.Core
Assembly:  NMath (in NMath.dll) Version: 7.4
Syntax
```[SerializableAttribute]
public class PLS1NipalsAlgorithm : IPLS1Calc```

The PLS1NipalsAlgorithm type exposes the following members.

Constructors
NameDescription
PLS1NipalsAlgorithm
Constructs an instance of the PLS1NipalsAlgorithm class.
Top
Properties
NameDescription
IsGood
Whether the most recent calculation was successful.
(Overrides IPLS1CalcIsGood.)
Message
Gets any message that may have been generated by the algorithm. For example, if the calculation is unsuccessful, the message indicates the reason.
(Overrides IPLS1CalcMessage.)
PredictorMean
Gets the vector of means for the predictor variables.
RegressionVector
Gets the vector of regression, r, which can be used for making predictions as follows:

Let ybar and xbar be the means of the response and predictor variables, respectively, used to create the model. Then the predicted response, yhat, for a predictor vector, z is given by the formula

`yhat = ybar + (z - xbar)'r`

ResponseMean
Gets the vector of means for the response variables.
ResponseWeights
Gets the vector of response weights. The ith element of this vector corresponds to the regression coefficient calculated by ordinary linear regression of the response vector on the ith score vector.
Scores
Gets the scores matrix for PredictorMatrix. The scores matrix is described in the class summary.
(Overrides IPLS1CalcScores.)
Weights
Returns the matrix of weights computed by the algorithm.
Top
Methods
NameDescription
Calculate
Calculates a partial least squares from the given data and number of components.
(Overrides IPLS1CalcCalculate(DoubleMatrix, DoubleVector, Int32).)
Clone
Creates a deep copy of this PLS1NipalsAlgorithm.
(Overrides IPLS1CalcClone.)
HotellingsT2
Calculaties Hotelling's T2 statistic for each sample. T2 can be viewed as the squared distance from a samples projection into the subspace to the centroid of the subspace, or, more simply, the variation of the sample point within the model.
(Inherited from IPLS1Calc.)
OnDeserialized
Sets most of the attributes only if isGood_
OnSerializing
Conditionally sets most of the values for serialization only if isGood_
Predict(DoubleMatrix)
Use the calculated model to predict the response values, ResponseVector, from the given set of predictor variables.
(Overrides IPLS1CalcPredict(DoubleMatrix).)
Predict(DoubleVector)
Use the calculated model to predict the response value, y, from the given value for the predictor variable.
(Overrides IPLS1CalcPredict(DoubleVector).)
QResiduals
Calculates the Q residuals for in sample in the model. The Q residual for a given sample is the distance between the sample and its projection in the subspace of the model.
(Overrides IPLS1CalcQResiduals.)
Top
Remarks
During the calculation the following model for PredictorMatrix (independent variable values) is formed:
`PredictorMatrix = TP' + Xg`
where
`g`
is the number of components specified for the model. T is called the scores matrix (the columns of T are the scores), and P is called the loadings matrix. The matrix Xg is called the residual matrix for PredictorMatrix.