help-octave
[Top][All Lists]

## Re: Leasqr matrix singular to machine precision

 From: Archambault Fabien Subject: Re: Leasqr matrix singular to machine precision Date: Wed, 27 Feb 2008 09:10:05 +0100 User-agent: Thunderbird 2.0.0.9 (X11/20080213)

```Doug Stewart a écrit :
```
```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)

```
```Thank your for your answer and you are right.

```
But I tried to make the calculation with a 4 system unknown and I still have the same error.
```
```
warning: in /usr/lib64/octave/2.1.73/oct/x86_64-mandriva-linux-gnu/inv.oct near line 302, column 8:
```warning: inverse: matrix singular to machine precision, rcond = 1.76168e-24

That is a really problematic error.

There are no other available function to make the same fit ?

--
Fabien Archambault
Equipe de dynamique des assemblages membranaires
Unité Mixte de Recherches CNRS UHP 7565
Université Henri-Poincaré, Nancy I BP 239,
54506 Vandoeuvre-lès-Nancy, cedex France

Tél : 03.83.68.43.96

```

reply via email to