# Using pdf to find threshold

조회 수: 3 (최근 30일)
Carly 2023년 1월 21일
답변: Image Analyst 2023년 1월 22일
Hello,
I am trying to determine a threshold for data that is p>0.05. The data is very positively skewed but I am unsure how to use or interpret the pdf() function to determine a threshold value. I want apply a 'Rayleigh'distribution but how do you choose the values for the input parameter B? I read the documentation but it does not give detailed explanation on how to choose these parameters. I've numeric matrix of example data. This is my code so far:
pd = fitdist(sample,'Rayleigh')
pd =
RayleighDistribution Rayleigh distribution B = 0.0844953 [0.0830468, 0.0859955]
x_values = 0:.01:.5;
y = pdf(pd,x_values);
plot(x_values,y)
But the next step is finding the threshold value which I am unsure how to do.
##### 댓글 수: 1이전 댓글 -1개 표시이전 댓글 -1개 숨기기
Torsten 2023년 1월 22일
I am trying to determine a threshold for data that is p>0.05.
Could you explain in more detail what you mean here ?

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

### 채택된 답변

Jeff Miller 2023년 1월 22일
I'm not entirely sure what you mean by "threshold", but maybe you are trying to identify the middle 95% of the distribution? If that is the case, then
>> icdf(pd,0.025)
ans =
0.019013
>> icdf(pd,0.975)
ans =
0.22951
tells you that scores less than 0.019013 are in the bottom 2.5% and scores greater than 0.22951 are in the top 2.5%, so the middle 95% is the range in between there. Alternatively, if you just want the bottom 95% then you would use
>> icdf(pd,0.95)
ans =
0.20682
the "icdf" function returns the value X of the distribution such that the indicated proportion is less than X.
hth,
##### 댓글 수: 1이전 댓글 -1개 표시이전 댓글 -1개 숨기기
Carly 2023년 1월 22일
Yes, that works perfectly! Thank you!

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

### 추가 답변 (1개)

Image Analyst 2023년 1월 22일
For skewed distributions such as that, the triangle method works well. Function is attached.

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

### 카테고리

Help CenterFile Exchange에서 Logistic Distribution에 대해 자세히 알아보기

R2021b

### Community Treasure Hunt

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

Start Hunting!

Translated by