I want to fit a function with a dataset using gnuplot.
I use a data set example, in the file "data":
1 2
5 4
6 5
7 8
If I do in gnuplot
>f(x) = a*x+b
>fit f(x) "data" via a,b
It works just good, (and with this example I get a≃0.855 and b≃0.687)
Now what I really want to do is to fit the function floor(a*x+b)
. So I tried exactly the same way
>f(x) = floor(a*x+b)
>fit f(x) "data" via a,b
And I get the output
Iteration 0
WSSR : 8 delta(WSSR)/WSSR : 0
delta(WSSR) : 0 limit for stopping : 1e-005
lambda : 0
initial set of free parameter values
a = 1
b = 1
Singular matrix in Givens()
error during fit
Googling it didn't help me, I also tried to find if there was some contraindication using fit with floor but again I didn't find anything.
Has someone an idea?
Note : I use Gnuplot 4.6 patchlevel 0, built for Windows 32bit