필터 지우기
필터 지우기

Probability density function for binary data

조회 수: 3 (최근 30일)
Tesla
Tesla 2021년 10월 2일
댓글: Tesla 2021년 10월 8일
I have data for the index of each point: 0 for the point outside particle, 1 for the points inside particle.
How to calculate calculate the PDF for this case? If you know that my domaine points is in [200 67].
And I want to calculate the PDF in a fixed x-point for example 80.

채택된 답변

Image Analyst
Image Analyst 2021년 10월 2일
Not sure what the PDF means in this context. You can compute the chance the particle will be a 0 or a 1. This would give a PDF with only two values on the x axis.
p(1) = sum(data == 0) / numel(data);
p(2) = sum(data == 1) / numel(data);
Is that what you want? Or do you have (x,y) locations for each point and want some sort of 2-D probability that the "1" will land at some location or radius?
  댓글 수: 12
Image Analyst
Image Analyst 2021년 10월 8일
Why isn't it just
% Get probability for various y values along the x=30 line.
pdf30 = meanArray(:, 30);
Tesla
Tesla 2021년 10월 8일
Thank you very much, it works!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by