3.25 FAQ-253 How do I perform curve fitting on my histogram plot?

CurveFit-on-Histogram

Last Update: 1/7/2016

When you have a histogram plot, if you perform a nonlinear curve fit on the data, what you end up fitting is the raw data and not the binned data.

To display a fitted curve on histogram, you can choose one of the following two methods:

Method 1: Perform distribution fit on raw data

Activate source worksheet. Select Statistics:Descriptive Statistics: Distribution Fit from menu.

Specify the distribution(s) you want to fit the data on Distributions tab. Make sure Histogram is selected on the Plots tab.

Specify other settings if needed. Click OK to perform distribution fit.

In the result sheet Dist1 that generates, you will find the histogram plot with distribution curve overlaid in the Histogram branch.

Method 2: Turn on distribution curve on histogram

Double click on the histogram to open the Plot Details dialog.

In the Distribution Curve group of Data tab, select one distribution type from the Type drop-down list.

Click OK button to show the distribution curve overlaying the histogram plot.

If you still want to fit the binned data, you can perform a frequency count on the raw data and then fit the bin counts with Nonlinear Curve Fit tool. But do keep in mind that performing a nonlinear curve fit on a histogram is not appropriate because of the following two concerns:

The bin counts are non-negative and thus measurement errors are asymmetric.

The bin counts are not independent.

To fit the binned data:

With the raw data active, select Statistics: Descriptive Statistics: Frequency Counts to perform the frequency count. A new worksheet will be created from which you can plot the Counts column as a column plot.

With that plot active, you can open the NLFit dialog and fit the data.

Alternatively,

Right-click on your histogram plot and choose Go to Bin Worksheet from the context menu. A new worksheet will be created containing the bin data. Since version 8.5.1 you can also click the Go to Bin Worksheet button on the Data tab of the Plot Details dialog to go to the bin worksheet.

Create your column plot from this bin worksheet.

With that new column plot active, you can fit the data with NLFit dialog.

Keywords:Histogram, Nonlinear Curve Fit, Frequency Count, Data Mode