www.gusucode.com > stats 源码程序 matlab案例代码 > stats/ComputeAndPlotNoncentralFDistributionPdfExample.m

    %% Compute and Plot Noncentral _F_ Distribution pdf
%

% Copyright 2015 The MathWorks, Inc.


%%
% Compute the pdf of a noncentral _F_ distribution with parameters |NU1 =
% 5|, |NU2 = 20|, and |DELTA = 10|. For comparison, also compute the pdf of
% an _F_ distribution with parameters |NU1 = 5| and |NU2 = 20|.
x = (0.01:0.1:10.01)';
p1 = ncfpdf(x,5,20,10);
p  = fpdf(x,5,20);

%%
% Plot the noncentral _F_ and _F_ distribution pdfs on the same figure. The
% peak of the noncentral _F_ distribution pdf (solid line) is further to the
% right than the peak of the _F_ distribution pdf (dotted line).
figure;
plot(x,p,':',x,p1,'-')