How can I use truncate function for F distribution?
이전 댓글 표시
I need the truncated F inverse cumulative distribution function. But makedist function do not work for "F". So, how can I use truncate function for "F" distribution? Thanks
답변 (1개)
n=100;
xu = rand(n);
xft = finv(fcdf(a,v1,v2)+xu*(fcdf(b,v1,v2)-fcdf(a,v1,v2)),v1,v2);
gives you n random numbers xft of the truncated F-distribution where
v1: numerator degrees of freedom
v2: denominator degrees of freedom
[a;b] : truncation interval.
Or to precisely answer your question:
The inverse cumulative distribution function of the truncated F-distribution finvt(x,v1,v2) is given by
finvt(x,v1,v2)=finv(fcdf(a,v1,v2)+x*(fcdf(b,v1,v2)-fcdf(a,v1,v2)),v1,v2)
Best wishes
Torsten.
댓글 수: 2
ati
2015년 10월 14일
The F distribution is not in the list of distributions you can apply the "makedist" command to:
Thus, there is also no way to truncate it with the "truncate" command:
However, the F distribution is part of the statistics toolbox. The cumulated distribution (fcdf) and its inverse (finv) can be used. Combining them in the way
finvt(x,v1,v2)=finv(fcdf(a,v1,v2)+x*(fcdf(b,v1,v2)-fcdf(a,v1,v2)),v1,v2)
you get the inverse of the cumulated distribution of the truncated F distribution on the truncation interval [a;b].
And using it as
n=100;
xu = rand(n);
xft = finv(fcdf(a,v1,v2)+xu*(fcdf(b,v1,v2)-fcdf(a,v1,v2)),v1,v2);
you can generate random numbers of the truncated F distribution.
I guess this is your final aim, isn't it ?
Best wishes
Torsten.
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!