Skip to main content
added 121 characters in body
Source Link
Andy Ross
  • 19.5k
  • 2
  • 62
  • 93

If you are trying to estimate the best fitting distribution you might also try something along these lines. I typically prefer to work with distributions through the powerful built-in framework. I've chosen a WeibullDistributionRayleighDistribution* since your data does not contain values below zero.

dist = EstimatedDistribution[WeightedData@@Transpose[data],
          WeibullDistribution[a, b]]RayleighDistribution[s]]

We can get a good estimate of the amplitude by taking the least squares estimate for a constant c that best scales the PDF to fit the original data.

x = PDF[dist, data[[All, 1]]];
y = data[[All, 2]];
c = 1/x.x x.y;

Now we can plot the rescaled PDF against the data.

Show[ListPlot[data], Plot[PDF[dist, x]*c, {x, 0, 4}], PlotRange -> All]

enter image description here

* I had initially chosen a WeibullDistribution but @Rahul expertly identified Rayleigh which is more parsimonious.

If you are trying to estimate the best fitting distribution you might also try something along these lines. I typically prefer to work with distributions through the powerful built-in framework. I've chosen a WeibullDistribution since your data does not contain values below zero.

dist = EstimatedDistribution[WeightedData@@Transpose[data],
          WeibullDistribution[a, b]]

We can get a good estimate of the amplitude by taking the least squares estimate for a constant c that best scales the PDF to fit the original data.

x = PDF[dist, data[[All, 1]]];
y = data[[All, 2]];
c = 1/x.x x.y;

Now we can plot the rescaled PDF against the data.

Show[ListPlot[data], Plot[PDF[dist, x]*c, {x, 0, 4}], PlotRange -> All]

enter image description here

If you are trying to estimate the best fitting distribution you might also try something along these lines. I typically prefer to work with distributions through the powerful built-in framework. I've chosen a RayleighDistribution* since your data does not contain values below zero.

dist = EstimatedDistribution[WeightedData@@Transpose[data], RayleighDistribution[s]]

We can get a good estimate of the amplitude by taking the least squares estimate for a constant c that best scales the PDF to fit the original data.

x = PDF[dist, data[[All, 1]]];
y = data[[All, 2]];
c = 1/x.x x.y;

Now we can plot the rescaled PDF against the data.

Show[ListPlot[data], Plot[PDF[dist, x]*c, {x, 0, 4}], PlotRange -> All]

enter image description here

* I had initially chosen a WeibullDistribution but @Rahul expertly identified Rayleigh which is more parsimonious.

deleted 3 characters in body
Source Link
Andy Ross
  • 19.5k
  • 2
  • 62
  • 93

If you are trying to estimate the best fitting distribution you might also try something along these lines. I typically prefer to work with distributions through the powerful built-in framework. I've chosen a WeibullDistribution since your data does not contain values below zero.

dist = EstimatedDistribution[WeightedData@@Transpose[data],
          WeibullDistribution[a, b]]

This getsWe can get a good approximation toestimate of the desired "amplitude" though it isamplitude by taking the least squares estimate for a quick and dirty approach. Others probably have better ideasconstant c that best scales the PDF to fit the original data.

cx = NIntegrate[(Interpolation[data])[x]PDF[dist, 
 data[[All, 1]]];
y = data[[All, 2]];
c = {1/x, Min[data[[All, 1]]],Max[data[[All,.x 1]]]}];x.y;

Now we can plot the rescaled PDF against the data.

Show[ListPlot[data], Plot[PDF[dist, x]*c, {x, 0, 4}], PlotRange -> All]

enter image description here

If you are trying to estimate the best fitting distribution you might also try something along these lines. I've chosen a WeibullDistribution since your data does not contain values below zero.

dist = EstimatedDistribution[WeightedData@@Transpose[data],
          WeibullDistribution[a, b]]

This gets a good approximation to the desired "amplitude" though it is a quick and dirty approach. Others probably have better ideas.

c = NIntegrate[(Interpolation[data])[x], 
       {x, Min[data[[All, 1]]],Max[data[[All, 1]]]}];

Now we can plot the rescaled PDF against the data.

Show[ListPlot[data], Plot[PDF[dist, x]*c, {x, 0, 4}], PlotRange -> All]

enter image description here

If you are trying to estimate the best fitting distribution you might also try something along these lines. I typically prefer to work with distributions through the powerful built-in framework. I've chosen a WeibullDistribution since your data does not contain values below zero.

dist = EstimatedDistribution[WeightedData@@Transpose[data],
          WeibullDistribution[a, b]]

We can get a good estimate of the amplitude by taking the least squares estimate for a constant c that best scales the PDF to fit the original data.

x = PDF[dist, data[[All, 1]]];
y = data[[All, 2]];
c = 1/x.x x.y;

Now we can plot the rescaled PDF against the data.

Show[ListPlot[data], Plot[PDF[dist, x]*c, {x, 0, 4}], PlotRange -> All]

enter image description here

Source Link
Andy Ross
  • 19.5k
  • 2
  • 62
  • 93

If you are trying to estimate the best fitting distribution you might also try something along these lines. I've chosen a WeibullDistribution since your data does not contain values below zero.

dist = EstimatedDistribution[WeightedData@@Transpose[data],
          WeibullDistribution[a, b]]

This gets a good approximation to the desired "amplitude" though it is a quick and dirty approach. Others probably have better ideas.

c = NIntegrate[(Interpolation[data])[x], 
      {x, Min[data[[All, 1]]],Max[data[[All, 1]]]}];

Now we can plot the rescaled PDF against the data.

Show[ListPlot[data], Plot[PDF[dist, x]*c, {x, 0, 4}], PlotRange -> All]

enter image description here