MATLAB Answers

Which equation does Matlab use to fit a Normal distribution?

47 ビュー (過去 30 日間)
Andreina Urquiola
Andreina Urquiola 2021 年 2 月 11 日
コメント済み: Andreina Urquiola 2021 年 2 月 15 日
Which equation does Matlab use to fit a Normal distribution?, especially for fitdist(x,'Normal') function. I would like to know if the fitting is given by:
or by another expression.
  2 件のコメント
Andreina Urquiola
Andreina Urquiola 2021 年 2 月 11 日
Different expressions can be used to minimize errors. For example Origin (data analysis software) uses this equation to obtain the gaussian fit:
I would like to know which expression is used by Matlab.

サインインしてコメントする。

採用された回答

Matt J
Matt J 2021 年 2 月 11 日
編集済み: Matt J 2021 年 2 月 11 日
To reverse engineer, we can fit the following data
x=randn(1e5,1)*2+5;
which is definitely distributed according to the first density parametrization that you posted (what I would consider the classical parametrization) with mu=5 and sigma=2. Since the routine gives us virtually the same sigma and mu as what we simulated, there is a good chance that the parametric model is the classical one:
pd = fitdist(x,'Normal')
pd =
NormalDistribution Normal distribution mu = 4.99612 [4.98373, 5.00851] sigma = 1.99916 [1.99044, 2.00796]
  2 件のコメント
Matt J
Matt J 2021 年 2 月 12 日
You're welcome, but please Accept-click an answer that you deem best solves your question.

サインインしてコメントする。

その他の回答 (1 件)

John D'Errico
John D'Errico 2021 年 2 月 11 日
I think you misunderstand, as there are several things happening here.
A normal distribution fit, that is, finding the parameters of a Normal PDF assumes the distribution has the property that the integral of that function is 1. A PDF has that property, and this is implicit in tools like fitdist.
However, IF you use some other software to perform a nonlinear regression fit, to a model as you show, thiis is NOT a normal distribution. It fails the property that the integral of that function is 1. In fact, the integral from -inf to inf is unbounded, if y0 is ANY number other than zero.
So it is NOT a normal distribution. You may call it a Gaussian fit, but the only thing it has in common with a normal distribution is it looks like a normal, and it is based on the same equation, though perhaps with some additional parameters. It is NOT a normal distribution.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by