How do i plot probability density plot with actual values?

조회 수: 1 (최근 30일)
israt fatema
israt fatema 2021년 11월 16일
댓글: Star Strider 2021년 11월 16일
How do i plot probability density curve with actual values as vertical line (as the picture attached)? And how to interpret that according to the distribution? Thank you.
  댓글 수: 2
israt fatema
israt fatema 2021년 11월 16일
You are really a great help. I have studied your other answers which are very helpful. Thanks a lot.
Star Strider
Star Strider 2021년 11월 16일
As always, my pleasure!

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

채택된 답변

Star Strider
Star Strider 2021년 11월 16일
If the distribution function is provided, along with the necessary parameters (none of which are prrovided here), this is straightforward —
x = linspace(1500, 2100);
mu = 1800;
sigma = 75;
npdf = normpdf(x, mu, sigma); % Use Normal Distribution To Demonstrate
npdf = 1×100
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0001 0.0001 0.0001 0.0001 0.0001 0.0002 0.0002 0.0003 0.0003 0.0004 0.0005 0.0005 0.0006 0.0007 0.0009 0.0010 0.0012 0.0013
figure
patch([x flip(x)], [zeros(size(npdf)) flip(npdf) ], 'b', 'FaceAlpha',0.25)
hold on
plot([1 1]*mu, [0 normpdf(mu, mu, sigma)], '-r', 'LineWidth',2)
hold off
Experiment with the intended distribution function and parameters.
.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by