To get the distribution, one should look at the sum of squares.
But this should be from the weighted sum of squares, which is stored as chi2.
The API provides a method of model_statistics(), to get:
k - number of parameters.
n - number of data points.
chi2 - the chi-squared value.
Then reduced chi2 can be computed. chi2_red = chi2/(n-k)
And the error distribution be drawn from this.
The command used was:
svn merge -r27213:r27201 .
Task #7882 (https://gna.org/task/?7882): Implement Monte-Carlo simulation, where errors are generated with width of standard deviation or residuals.