i am required to plot an f-distribution for the given degrees of freedom v1 and v2 determined from 4 samples and shade the rejection region for the given alpha(like in the picture below) rejection region shading however i cannot figure out how to do so and anything i tried doesn't seem to work. attached is my code so far.
clear
clc
format short g
%% Samples
s1=[407 411 409];
s2=[404 406 408 405 402];
s3=[410 408 406 408];
s4=[400 413 407 405 403 410 409];
observations=[s1 s2 s3 s4];
%% degrees of freedom
n=4; %no of samples
m=length(observations);
v1=n-1
v2=m-n
%% Level of sig
alpha=0.05
level_of_sig=1-alpha
critical_value=finv(level_of_sig,v1,v2)
%% Plotting F-Dist
x=0:0.01:max(observations);
fdist=fpdf(x,v1,v2);
fig1 = figure(1);
hold on
plot(x,fdist,'LineWidth',1.5)
xline(0,'Color', [0.5 0.5 0.5])
yline(0,'Color', [0.5 0.5 0.5])
grid on
% shading rejection region <<<<<<<<<<<<<<<< not working
grey = [127 127 127]./255;
area(x(critical_value:max(observations)),fdist(critical_value:max(observations)),'basevalue',0,'FaceColor',grey);
hold off