I am trying to fit a series of data using a non linear equation. I have tried with the NonlinearModelFit function but it gives me unsatisfactory answer.
I am attaching the data file I am working on and the non linear equation.
Nonlinear fitting is an optimization problem. Most of the time, an unacceptable answer appears because a local minimum is found while searching for the least squares.
You can use the Method option to select a different optimization method.
Use FindFit. FindFit allows you to specify starting values for the values of the parameters. You provide an estimation of what the corrects results are to ensure that the answer converges to the solution you are looking for.
What kind of result do you expect? Does this result have a small east squares residual?
You’ve provided some data files and a PDF. Would it be possible for you to provide a notebook with some code? This would make it easier for people to guess which data set each variable referred to.
My expected fit is a double Gaussian fit. The parameters are n, a and b. The independent variable is x. I am attaching the mathematica file. Perhaps this will help.
This is a common mistake, but this is not the correct way to estimate the parameters of a probability distribution.
I’m not exactly sure what you are doing in the notebook. Are you trying to fit to the CDF or Survival function of the sum of two Gaussian distributions? If so, wouldn’t the range of the points be between 0 and 1?
It doesn’t matter either way. There are correct ways to estimate the parameters of a distribution from a set of samples. The function EstimateDistribution does this.
For example, here is how you define a Mixture Distribution of two Gaussians with different means, but the same variance: