## #165 Singular matrix in Invert RtR error during fit

open
nobody
None
5
2014-03-08
2014-03-07
Carla
No

I'm having a problem during fit my data.
I have data for x,y,z and I want find a good correlation for z as a function of x and y. From the data vizualization I can guess that the expression will be z=-ax+by+c. I tried fit the data with this kind of expression and I obtained

"Singular matrix in Invert RtR error during fit"

If I try an expression like z=-x+y+c there are no problems with the data fitting, but the expression predict higher values and not so close to the data as expected. Then I tried adjust by hand the a,b and c parameters and I get a better approximation to the data than the previous.

Why is this happening and how can I solve it?

## Discussion

• That's impossible to answer without seeing a good deal more details of the problem. For starters: the actual data, the exact gnuplot command sequence, the version of gnuplot you're running.

• Carla - 2014-03-08

Please find in attachment the actual data and the exact gnuplot command
sequence tested. I'm using gnuplot version 4.6.
I'm quite new on using gambit to fit 3D data...

2014-03-07 21:46 GMT+01:00 Hans-Bernhard Broeker broeker@users.sf.net:

That's impossible to answer without seeing a good deal more details of the
problem. For starters: the actual data, the exact gnuplot command sequence,
the version of gnuplot you're running.

Status: open
Group:
Created: Fri Mar 07, 2014 11:41 AM UTC by Carla
Last Updated: Fri Mar 07, 2014 11:41 AM UTC
Owner: nobody

I'm having a problem during fit my data.
I have data for x,y,z and I want find a good correlation for z as a
function of x and y. From the data vizualization I can guess that the
expression will be z=-ax+by+c. I tried fit the data with this kind of
expression and I obtained

"Singular matrix in Invert RtR error during fit"

If I try an expression like z=-x+y+c there are no problems with the data
fitting, but the expression predict higher values and not so close to the
data as expected. Then I tried adjust by hand the a,b and c parameters and
I get a better approximation to the data than the previous.

## Why is this happening and how can I solve it?

Sent from sourceforge.net because you indicated interest in
https://sourceforge.net/p/gnuplot/support-requests/165/

To unsubscribe from further messages, please visit
https://sourceforge.net/auth/subscriptions/

#### Related

• The reason is quite simple: your commands failed to actually make a 3D fit because they lack the necessary "using" specification.

```fit f(x,y) "3DdataLinear.txt" using 1:2:3:(1.0) via a0,a1,a2
```

would have worked.

• Carla - 2014-03-09

It is working now. Thank you!

2014-03-08 22:05 GMT+01:00 Hans-Bernhard Broeker broeker@users.sf.net:

The reason is quite simple: your commands failed to actually make a 3D fit
because they lack the necessary "using" specification.

fit f(x,y) "3DdataLinear.txt" using 1:2:3:(1.0) via a0,a1,a2

## would have worked.

Status: open
Group:
Created: Fri Mar 07, 2014 11:41 AM UTC by Carla
Last Updated: Sat Mar 08, 2014 12:21 PM UTC
Owner: nobody

I'm having a problem during fit my data.
I have data for x,y,z and I want find a good correlation for z as a
function of x and y. From the data vizualization I can guess that the
expression will be z=-ax+by+c. I tried fit the data with this kind of
expression and I obtained

"Singular matrix in Invert RtR error during fit"

If I try an expression like z=-x+y+c there are no problems with the data
fitting, but the expression predict higher values and not so close to the
data as expected. Then I tried adjust by hand the a,b and c parameters and
I get a better approximation to the data than the previous.

## Why is this happening and how can I solve it?

Sent from sourceforge.net because you indicated interest in
https://sourceforge.net/p/gnuplot/support-requests/165/

To unsubscribe from further messages, please visit
https://sourceforge.net/auth/subscriptions/

#### Related

• Carla - 2014-03-08

Last edit: Carla 2014-03-08