help-octave
[Top][All Lists]

## Re: Leasqr matrix singular to machine precision

 From: Doug Stewart Subject: Re: Leasqr matrix singular to machine precision Date: Tue, 26 Feb 2008 06:25:33 -0500 User-agent: Thunderbird 1.5.0.14 (Windows/20071210)

```Archambault Fabien wrote:
```
```Dmitri A. Sergatskov a écrit :
```
```On Mon, Feb 25, 2008 at 3:26 PM, Archambault Fabien
```
```Przemek Klosowski a écrit :
>    For the weight on some points I thought of it but as the values I get
>    are all of the same importance I think fitting with wt = (1) is a
>    correct guess.
>
> I would caution against it---every target point has its own
> experimental, or systematic, or other kind of error, and those errors
> are rarely the same for all points. For instance, if the points were
> calculated in a counting experiment, i.e. they represent counts per
> some unit of time, or are a result of a monte carlo simulation, their
> error will likely be proportional to the square root of the value.
>
>
>       p
>
>
Hi,

no values that are fitted are not from experimental values they are from
QM calculations so each points are the "truth" (compared with MM values).
In the last tests I made it was still impossible to achieve on 4 (or 6
unknown). Also the lmder (in Fortran) did not work well... And since
today I tried to solve it with the nonlinear fitting of Xmgrace
(constrained values are possible) and it is still not very good in fit.

Still working on it but few hope (lol).
```
```All this should give you a clue that you are doing something wrong.
In fact your equation has only 4 independent variables (I re-wrote it
for clarity):

Y = A*( ((x1/r1)^12 -(x1/r1)^6) + ((x1/r2)^12 -(x1/r2)^6) +
B*((x2/r3)^12 - (x2/r3)^6) )

So the parameters here is A, B, x1 and x2.

Fitting this with 6 parameters will not work.
```
``` --
Fabien Archambault
```
```Dmitri.
--

```
```Hi,

```
thanks for taking time to rewrite it but for the first example I took there is 6 parameters. In your notations it will be written as :
```
```
Y = A*B*( ((x1+x2)/r1)^12 - 2*((x1+x2)/r2)^6) + A*C*( ((x1+x3)/r1)^12 - 2*((x1+x3)/r2)^6) + A*C*( ((x1+x3)/r1)^12 - 2*((x1+x3)/r2)^6) = A*B*( ((x1+x2)/r1)^12 - 2*((x1+x2)/r2)^6) + 2*A*C*( ((x1+x3)/r1)^12 - 2*((x1+x3)/r2)^6)
```
```
When I first wrote my email I forgot the 2* before the 6 exponant part but it did not solve it.
```
```
I think when I write like this you see 6 unknown or there is something that escapes to me (and to 2 other people).
```
```
```
here is what I see.
Yours is:
Y = A*B*( ((x1+x2)/r1)12 - 2*((x1+x2)/r2)6) + A*C*( ((x1+x3)/r1)12 -
2*((x1+x3)/r2)6) + A*C*( ((x1+x3)/r1)12 - 2*((x1+x3)/r2)6)
= A*B*( ((x1+x2)/r1)12 - 2*((x1+x2)/r2)6) + 2*A*C*(
((x1+x3)/r1)12 - 2*((x1+x3)/r2)6)

c1=A*B
c2=X1+X2
c3=A*C
c4=X1+X3

Y = c1*( ((c2)/r1)12 - 2*((c2)/r2)6) + c3*( ((c4)/r1)12 -
2*((c4)/r2)6) + c3*( ((c4)/r1)12 - 2*((c4)/r2)6)
= c1*( ((c2)/r1)12 - 2*((c2)/r2)6) + 2*c3*(
((c4)/r1)12 - 2*((c4)/r2)6)

```