# Finding the best fit for a given data and the best guess values when fitting a given equation

If I have the following data

Import["https://pastebin.com/raw/1XhEEJCr", "Package"]


Which gives the following Figure: I have two questions:

## Question 1

Is there any way that Mathematica with a code can tell you what is the best fit for this data and give the parameters?.

## Question 2

If I wanted to fit this data let's say to the following equation:

r10 E^(-((r00 - x)/r20)) r20^-r30 (r00 - x)^(-1 + r30)


where I am using the following code

NonlinearModelFit[data,r10 E^(-((r00 - x)/r20)) r20^-r30 (r00 - x)^(-1 + r30), {{r10,0.62}, {r20, 0.5}, {r30, 22}}, x];


Is there any way to ask Mathematica or to know what would be the best guesses for this or any data?.

For this case the guess values for r10,r20 and r30 are not correct and I am not sure how I will go about finding the best guess to try to fit this data to that equation and see if that fits or not.

Thank you

• 1) No: a sensible model must come from the physical meaning of the data; No algorithm can do that reliably. 2) Not really; in fact, a good choice of initial values is often the most difficult yet important choice in fitting data sensibly. – MarcoB May 12 '20 at 5:12
• Question 2): You could use NonlinearModelFit without starting values: NonlinearModelFit[data,r10 E^(-((r00 - x)/r20)) r20^-r30 (r00 - x)^(-1 + r30), {r10 , r20 , r30 }, Method -> "NMinimize"] . By the way, are you sure about your modelfunction? I would expect the exponential term to be Exp[- (r00-x)^2 …] – Ulrich Neumann May 12 '20 at 8:30
• @UlrichNeumann thanks! The model of question 2 seem to fit other curves that are similar to the one posted. The model was suggested by JimB here: mathematica.stackexchange.com/questions/221229/… – John May 12 '20 at 17:02
• @John Try NonlinearModelFit[…,x,Method->"NMinimize"] – Ulrich Neumann May 12 '20 at 19:00
• @John Your yellow-plot shows something like a bell curve, that 's why I would expect a squared exponent Exp[- (r00-x)^2 …] in your model! Unfortunately I cannot excess your data... – Ulrich Neumann May 12 '20 at 19:06