On 24.08.2020, at 23:08, Rafael Guerra <[email protected]> wrote: > > Hi Heinz, > > For the regression errors, I am not an expert but from wikipedia or from > reference below, I would risk the following code (at your peril): > https://pages.mtu.edu/~fmorriso/cm3215/UncertaintySlopeInterceptOfLeastSquaresFit.pdf > > // Note: for degrees of freedom>=6, t-distribution ~2 > N = length(MW); > mx = mean(MW); > SSxx = sum((MW -mx).^2); > Ea = diag(2*sig/sqrt(SSxx)) // take Ea diagonals; slope 95% confidence > Eb = diag(2*sig*sqrt(1/N+mx^2/SSxx)) // take Eb diagonals; intercept 95% > confidence > > Concerning the least squares regression part, it seems the code may be > written more compactly using reglin: > > [a,b,sig]=reglin(MW',Y') // simple least squares linear regression > GG= a.*.xx' + repmat(b,size(xx')) > plot(xx,GG','LineWidth',1);
Here is a little misunderstanding (my fault: I had not explained it). I want all three straight lines to go simultaneously through one point at the negative x-axis. This is why I had to use a non-linear least-squares fit. Heinz
_______________________________________________ users mailing list [email protected] http://lists.scilab.org/mailman/listinfo/users
