[Scilab-users] evaluate error on each parameter calculated with leastsq

Yohann yohann.morille at univ-angers.fr
Tue Feb 18 15:06:48 CET 2014


Hi all !!

First of all, thank you to all contributors of Scilab.
However, I have a problem to calculate the estimated error on each parameter
calculated with leastsq.

For example if I have the simple following function  to fit:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
function y = fun2fit(x, c)
  y =  c(1)*x*x + c(2)*x + c(3);
endfunction 

function e = myerror(c, x, y)
  e = fun2fit(x, c) - y;
endfunction 

// Data
x = [ 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6]';
y = [5.02  6.08  3.33 -0.93   -0.22  7.83  16.52 15.55  2.67 -11.42 -11.78 
5.09 25.25]';   

// First guess
c0 = [1 1 1]';
y0 = fun2fit(x, c0); 

// least square 
[f, copt] = leastsq(list(myerror, x, y), c0) 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I'd like to have an estimated error on each of the 3 element of copt.
Any idea ?

Thanks !
Y





--
View this message in context: http://mailinglists.scilab.org/evaluate-error-on-each-parameter-calculated-with-leastsq-tp4028696.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list