/// <summary> /// Plots the cross predicted versus actual Y (concentration) into a provided layer. /// </summary> /// <param name="table">The table of PLS output data.</param> /// <param name="layer">The layer to plot into.</param> /// <param name="whichY">The number of the component (y, concentration etc.) for which to plot the residuals.</param> /// <param name="numberOfFactors">The number of factors used for calculation of the residuals.</param> public static void PlotCrossPredictedVersusActualY(Altaxo.Data.DataTable table, XYPlotLayer layer, int whichY, int numberOfFactors) { string ypredcolname = WorksheetAnalysis.GetYCrossPredicted_ColumnName(whichY, numberOfFactors); string yactcolname = WorksheetAnalysis.GetYOriginal_ColumnName(whichY); if (table[ypredcolname] == null) { GetAnalysis(table).CalculateCrossPredictedAndResidual(table, whichY, numberOfFactors, true, false, false); } PlotOnlyLabel(layer, table[yactcolname], table[ypredcolname], table[WorksheetAnalysis.GetMeasurementLabel_ColumnName()]); layer.DefaultXAxisTitleString = string.Format("Y original{0}", whichY); layer.DefaultYAxisTitleString = string.Format("Y cross predicted{0} (#factors:{1})", whichY, numberOfFactors); }
/// <summary> /// Plots the x (spectral) residuals into a provided layer. /// </summary> /// <param name="table">The table of PLS output data.</param> /// <param name="layer">The layer to plot into.</param> /// <param name="whichY">The number of the component (y, concentration etc.) for which to plot the residuals.</param> /// <param name="numberOfFactors">The number of factors used for calculation of the residuals.</param> public static void PlotXResiduals(Altaxo.Data.DataTable table, XYPlotLayer layer, int whichY, int numberOfFactors) { string xresidualcolname = WorksheetAnalysis.GetXResidual_ColumnName(whichY, numberOfFactors); string yactcolname = WorksheetAnalysis.GetYOriginal_ColumnName(whichY); if (table[xresidualcolname] == null) { GetAnalysis(table).CalculateXResidual(table, whichY, numberOfFactors); } PlotOnlyLabel(layer, table[yactcolname], table[xresidualcolname], table[WorksheetAnalysis.GetMeasurementLabel_ColumnName()]); layer.DefaultXAxisTitleString = string.Format("Y original{0}", whichY); layer.DefaultYAxisTitleString = string.Format("X residual{0} (#factors:{1})", whichY, numberOfFactors); }