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

Answers (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 Comments

Thanks for your reply. However, by truncate I mean truncated probibilty distribution. See http://nl.mathworks.com/help/stats/prob.truncatabledistribution.truncate.html
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.

Sign in to comment.

Asked:

ati
on 14 Oct 2015

Edited:

on 15 Oct 2015

Community Treasure Hunt

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

Start Hunting!