이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
Fit chi distribution to measurement data
조회 수: 15 (최근 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!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 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 (한국어)