[Scilab-users] Error in parameters determined in non-linear least-squares fitting

stephane.mottelet at utc.fr stephane.mottelet at utc.fr
Sat Apr 4 17:00:12 CEST 2020


  Hello Heinz,

You can have a look at pages 45-49 of my slides on least Squares :

http://www.utc.fr/~mottelet/mt94/leastSquares.pdf

Page 48 you have an example where the Covariance matrix is  
approximated for a fitting problem with an ode defined page 42.

S.

Quoting Heinz Nabielek <heinznabielek at me.com>:

> Scilab friends: the power of Scilab is amazing and I have used it  
> recently for non-linear least-squares fitting, below example from  
> Scilab help function for "datafit". On occasions, I have also used  
> "leastsq".
>    
>   Question: how do I derive the 1sigma standard error in the three  
> parameters p(1), p(2), and p(3)? And, if it is not too complicated,  
> covariances?
>    
>   I know this is written in dozens of textbooks, but I am always  
> getting lost.
>   Please provide a simple recipe written in Scilab.
>   Best greetings
>   Heinz
>    
>    
>    
>   // -- 04/04/2020 14:57:30 -- ////generate the datafunction y=FF(x,  
> p)  y=p(1)*(x-p(2))+p(3)*x.*xendfunctionX=[]; Y=[]; pg=[34;12;14]  
> //parameter used to generate datafor x=0:.1:3   
> Y=[Y,FF(x,pg)+100*(rand()-.5)];   X=[X,x]; endZ=[Y;X]; //The  
> criterion functionfunction e=G(p, z),   y=z(1),x=z(2);    
> e=y-FF(x,p), endfunction//Solve the  
> problemp0=[3;5;10][p,err]=datafit(G,Z,p0);  
> scf(0);clf()plot2d(X,FF(X,pg),5) //the curve without  
> noiseplot2d(X,Y,-1)  // the noisy dataplot2d(X,FF(X,p),12) //the  
> solutionxgrid();legend("the curve without noise"," the noisy data",  
> "THE FINAL SOLUTION.....",4); title("solution set   39.868419     
> 10.312053    11.482521","fontsize",4);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20200404/e921eb26/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-2.tiff
Type: image/tiff
Size: 39064 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20200404/e921eb26/attachment.tiff>


More information about the users mailing list