現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
Fit chi distribution to measurement data
8 ビュー (過去 30 日間)
古いコメントを表示
dj1du
2022 年 8 月 16 日
Good Morning,
I would like to fit a chi distribution (not chi-squared!) with 6 degrees of freedom to my measurement data. Unfortunately, the chi distribution does not seem to be implemented in the Matlab function fitdist, and the only possibility I found was described in:
Although there is an example for a Laplace distribution on how to define a custom distribution, I'm not sure which lines of code to change, in order to define my chi distribution properly. Could someone perhaps help me out here?
Thank you very much!
BTW: I found out, that the Nakagami distribution supported by fitdist is similar to a chi distribution, but I really need to use a chi distribution and not a Nakagami one!
採用された回答
Torsten
2022 年 8 月 16 日
Square your measurement data, and you can fit them against a chi-squared distribution.
21 件のコメント
Torsten
2022 年 8 月 16 日
編集済み: Torsten
2022 年 8 月 16 日
Then use the parameters obtained from the chi-squares fit in the chi-distribution and compare to your unsquared data.
Do you have a curve you want to fit the chi distribution to or only a one-dimensional data vector ?
See under
whether curve fitting or distribution fitting applies in your case.
dj1du
2022 年 8 月 16 日
Ok good suggestion, but nevertheless I need a plot of a chi distribution, under any circumstances.
Torsten
2022 年 8 月 16 日
But I gave you the way how to get a plot of the fit of your data with a chi-distribution. Don't you understand what I meant ?
dj1du
2022 年 8 月 16 日
編集済み: dj1du
2022 年 8 月 16 日
I'm sorry, I didn't see the last sentence of your response. I have a 1D data vector to which the chi distribution should be fitted. Perhaps you can explain it once again in a step by step manner, as I am not really sure about the procedure you mentioned, to be honest.
Torsten
2022 年 8 月 16 日
No, I meant the first sentence:
Fit your data squared to a chi-squared distribution, insert the parameters thus obtained in the chi distribution and plot the chi distribution together with a histogram of your data unsquared.
dj1du
2022 年 8 月 16 日
Ok, the chi- and chi-squared distribution have both just one same distribution parameter, so when I have determined this parameter by fitting the squared data, what's the Matlab command for plotting the chi distribution eventually? Or do I have to program the chi distribution's pdf manually with the known distribution parameter? Sorry for asking...
dj1du
2022 年 8 月 16 日
Ok, the use of mle looks more straight-forward, I will try this solution, I guess. Thank you again for your help!
Torsten
2022 年 8 月 16 日
Maybe there is a statistician in the forum who can tell whether it's legitimate to fit a chi squared distribution to measurement data squared if one knows that the data unsquared follow a chi distribution. I'm not quite sure if this introduces a bias in the parameter estimation.
dj1du
2022 年 8 月 17 日
By the way: How can I fit a chi-squared distribution to my squared data? I just found out that chi-squared distributions are not supported by MATLAB functions like fitdist!
dj1du
2022 年 8 月 17 日
編集済み: dj1du
2022 年 8 月 17 日
I tried mle based on the following code
chipdf = @(data,k) ...
(data.^(k-1).*exp(-(data.^2)/2))/((2^(k/2-1))*gamma(k/2));
phat_hirf = mle(measurement_data,'pdf',chipdf,'Start',1)
and it gives me the desired distribution parameter k, but to be sure this method really provides correct results, I was hoping for implementing your alternative chi-squared approach, too, and compare the result from both different methods. But chi-square is not implemented in Matlab for fitting, unfortunately, so I don't know how to implement your chi-squared approach...
dj1du
2022 年 8 月 17 日
Yes, but as I need all this stuff for a publication I want to be absolutely sure and try a second method for comparison. Any ideas left?
Torsten
2022 年 8 月 17 日
Distribution Fitter. As you write, an example for a Laplace Distribution is given. Doesn't sound too difficult to imitate it for your case.
Torsten
2022 年 8 月 17 日
And you write in your first question that you want to fit a chi distribution with 6 degrees of freedom to your measurement data. Why do you need to fit it if you already know the parameter k ? To check whether it turns out to be 6 ?
その他の回答 (0 件)
参考
タグ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)