|
From: Spinora <N.M...@gm...> - 2007-11-15 09:30:36
|
Hi I have data with 3 values: x,y and z and I would like to fit f(x,y) to it. I read in the help that the usual fit-function could do the job but when i actually try it the fitted function in nowhere near my data. I've tried differnt functions and they all seemed to fail in different ways: one kept quitting after 2 iterations, giving back the starting values, one did about 15 Iterations and gave back something far from the starting values but even further from the data, one kept giving back a nearly flat plane (which is pretty wrong) but at least it seemed to be at the average of the data. >From this variety of errors I was unable to find out what went wrong, hope someone can help me here. cheers Spinora -- View this message in context: http://www.nabble.com/3-d-fitting-tf4810729.html#a13764386 Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Thomas S. <t.s...@fz...> - 2007-11-15 10:30:34
|
Spinora wrote: > > I have data with 3 values: x,y and z and I would like to fit f(x,y) to it. > I read in the help that the usual fit-function could do the job but when i > actually try it the fitted function in nowhere near my data. > > I've tried differnt functions and they all seemed to fail in different > ways: one kept quitting after 2 iterations, giving back the starting > values, one did about 15 Iterations and gave back something far from the > starting values but even further from the data, one kept giving back a > nearly flat plane (which is pretty wrong) but at least it seemed to be at > the average of the data. > From this variety of errors I was unable to find out what went wrong, hope > someone can help me here. > the first question you have to answer is: which function would describe your data best? then use this function and set the parameters by hand, so that the function is already in the region where the datapoints are, and then start the fit. if you start a fit with parameters set to values which cause the function to be far off the datapoints, then this fit will not work. due to the inadequate stepsize chosen automatically it may find some minimum but not the real one (for comparison: with 1m steps you may explore the bumpiness of a floor but will not find a hole which has a diameter of 1mm and is 10.5m away). -- View this message in context: http://www.nabble.com/3-d-fitting-tf4810729.html#a13765109 Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Spinora <N.M...@gm...> - 2007-11-15 11:04:18
|
Thomas Sefzick wrote: > > the first question you have to answer is: > which function would describe your data best? > > then use this function and set the parameters by hand, so that the > function is already in the region where the datapoints are, and then start > the fit. > > if you start a fit with parameters set to values which cause the function > to be far off the datapoints, then this fit will not work. due to the > inadequate stepsize chosen automatically it may find some minimum but not > the real one (for comparison: with 1m steps you may explore the bumpiness > of a floor but will not find a hole which has a diameter of 1mm and is > 10.5m away). > I have tried several starting Values some quite close to what I thought by eye might be an okay value (although not brilliant). In that case it just did one Iteration and then told me that was best it could do, although I am sure it's not. The thing is I need a function as simple as possible so its a kind of step-function in x direction and constant in y direction the parameters are height, width and offset (although i have tried other functions). All I want to do with this is find out if there is a bump somewhere in my data which is straight in y-direction. So the fit is supposed to do really bad if thats not the case and give back lots of chisquare. -- View this message in context: http://www.nabble.com/3-d-fitting-tf4810729.html#a13765313 Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Thomas S. <t.s...@fz...> - 2007-11-15 11:18:35
|
could you make an example available? (data file, function) -- View this message in context: http://www.nabble.com/3-d-fitting-tf4810729.html#a13765780 Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Spinora <N.M...@gm...> - 2007-11-15 11:29:04
|
Thomas Sefzick wrote: > > could you make an example available? (data file, function) > > ...something's broken either with my browser or with this website... when i click a link it keeps just reloading the page i'm on... my favorite function was f(x,y)= a*(sgn(x-b+c)-sgn(x-b-c)) which is a stepfunction of the height a, width c and offset b. my data looks like this: 0 0 0 1 0 0 2 0 0 3 0 0 4 0 1 5 0 15 6 0 20 7 0 3 8 0 0 9 0 0 10 0 0 0 1 0 1 1 0 2 1 0 3 1 0 4 1 0 5 1 11 6 1 20 7 1 1 8 1 1 9 1 0 10 1 0 0 2 0 1 2 0 2 2 0 3 2 2 4 2 1 5 2 16 6 2 16 7 2 0 8 2 0 9 2 0 10 2 0 0 3 0 1 3 0 2 3 0 4 3 3 5 3 18 6 3 21 7 3 11 8 3 0 9 3 0 10 3 0 0 4 0 1 4 0 2 4 0 3 4 0 4 4 1 5 4 4 6 4 15 7 4 6 8 4 0 9 4 0 10 4 0 does that help? startingvalues I've tried were a=20, b=6, c=2 -- View this message in context: http://www.nabble.com/3-d-fitting-tf4810729.html#a13765786 Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Thomas S. <t.s...@fz...> - 2007-11-15 14:08:36
|
this fit can not work: the 1st derivatives of f(x,y) with respect to 'b' and 'c' are delta functions chisq only changes when the borders of your 'box-interval' cross datapoints. e.g. with the starting values a=20; b=6; c=1.5 you get the fit result: a = 5.9 b = 6 c = 1.5 but you will get the same fit result for 'a' for 1.0 < c < 2.0 or 5.5 < b < 6.5 and 'b' and 'c' are not changed at all. (if the interval borders are on datapoints, the fit result is unpredictable) in principle you are calculating the mean of all datapoints inside the 'box-intervall'. you need a continuous function for fitting, e.g. a normal distribution: n(x)=c*exp(-(x-a)**2/b) -- View this message in context: http://www.nabble.com/3-d-fitting-tf4810729.html#a13768274 Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: <HBB...@t-...> - 2007-11-15 21:13:30
|
Spinora wrote: > ...something's broken either with my browser or with this website... FYI: "this" is not a website. It's a mailing list. We don't know which freeloading website you contact it by. See my reply to the newsgroup for the most likely problems with your fit command. |