Message Boards Message Boards

0
|
6685 Views
|
6 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Non linear fit help

Hi all,

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.

Any help is appreciated.

Attachments:
POSTED BY: suvadip mandal
6 Replies
  1. What values for the parameters are more reasonable? Try using these as starting values for FindFit.
  2. What is this equation? Is it the CDF of the distribution? The PDF of the distribution? If so, your data doesn't make any sense.
POSTED BY: Sean Clarke

Sir,

I tried to use the FindFit function but again I have got something which should not get. I have attached the file and please tell me what is wrong.

I have got this data from an experiment and all I know is that the fit should be a double Gaussian fit of that structure.

Attachments:
POSTED BY: suvadip mandal

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:

MixtureDistribution[{1, 1}, {NormalDistribution[m1, v], NormalDistribution[m2, v]}]
POSTED BY: Sean Clarke

Sir,

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.

Attachments:
POSTED BY: suvadip mandal

Finally, looking at your formula...

Is x the independant variable in the formula? If so you might be able to transform the x values so this is a linear problem.

x = Sqrt[Log[newx]]

E^(x^2) = newx

When x>1 this is an injective map that linearizes your equation.. unless I'm missing something.

POSTED BY: Sean Clarke

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.

POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract