0

Sorry if I'm asking a stupid question here, but I'm a real noob concerning gnuplot so please be patient.

I have a set of data and tried to fit it with

       f(x)=a * cos(x-b)**2 via a,b. 

But it didn't work. It should look like this,

enter image description here

but it turned out like this enter image description here

What could be the Problem with my fit equation?

1 Answer 1

1

Your nonlinear fit converged to a local minimum, not the global one. You need to start fitting closer to the global minimum (which you as a human can find much more easily than a computer).

So you need to specify starting values for a and b that are closer to what you expect, via

a = ...

b = ...

before you call fit.

Have a look at this documentation section:

http://theochem.ki.ku.dk/on_line_docs/gnuplot/gnuplot_21.html#SEC77

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.