Let
double[,] x = { { 1.05, 1.96, 3.02 }, { 3.94, 4.98, 6.04 }, { 5, 6, 7 } };
double[,] y = { { 11 }, { 13 }, { 13.68 } };
The following code works:
PartialLeastSquaresAnalysis pls = new PartialLeastSquaresAnalysis(x, y, PartialLeastSquaresAlgorithm.SIMPLS);
int factors = 1;
pls.Compute(factors);
Console.WriteLine(pls.Factors.Count);
The following code also works:
PartialLeastSquaresAnalysis pls = new PartialLeastSquaresAnalysis(x, y, PartialLeastSquaresAlgorithm.NIPALS);
pls.Compute();
Console.WriteLine(pls.Factors.Count);
The following code gives an exception:
PartialLeastSquaresAnalysis pls = new PartialLeastSquaresAnalysis(x, y, PartialLeastSquaresAlgorithm.NIPALS);
int factors = 1;
pls.Compute(factors);