필터 지우기
필터 지우기

Can I use the Matlab function called "dice" to compare two histograms (or discrete probability distributions)?

조회 수: 5 (최근 30일)
Can I use the Matlab function called "dice" (i.e. the "Sørensen-Dice similarity coefficient for image segmentation") to compare two histograms (or discrete probability distributions)?
similarity = dice(hist1,hist2)

채택된 답변

John D'Errico
John D'Errico 2023년 7월 12일
No. Use of the dice function to compare hisograms would be a complete misuse of the tool. Instead, you might better use tools from statistics that are designed for the purpose of comparing two distributions.
So perhaps a Kolmogorov-Smirnov test. You could use kstest2 to decide if the two underlying samples that were used to generate the histograms come from the same distributions.
  댓글 수: 1
Sim
Sim 2023년 7월 12일
Thanks a lot both @Malay Agarwal and @John D'Errico for your answers..!! In general, I have used already pdist2 and kstest2, and I just wanted to employ the Sørensen-Dice similarity... :-)

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Malay Agarwal
Malay Agarwal 2023년 7월 12일
편집: Malay Agarwal 2023년 7월 12일
Hi Sim
I am not sure if the dice function can be used to compare two histograms, but you can use the function pdist2 to get a similarlity score between the histograms. Please refer to this MATLAB answer: comparison of two histograms using pdist2 - MATLAB Answers - MATLAB Central (mathworks.com).

Community Treasure Hunt

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

Start Hunting!

Translated by