You are on page 1of 1

clc;

clear;
n = 3; % m0
k = 2; % n alternatives
P = 0.95; % P* in the equation
F = @(x,y,h) normcdf(h./sqrt((n-1)*(1./x+1./y))); %normcdf cumulative distribution function (cdf) of the standard
normal distribution
g1 = @(y,h)integral(@(x) F(x,y,h).*chi2pdf(x,n-1),0,Inf, 'ArrayValued', true); %chi2pdf returns the probability
density function (pdf) of the chi-square distribution
g2 = @(h) integral(@(y) (g1(y,h).^(k-1)).*chi2pdf(y,n-1),0,Inf)-P;
bsolve = fzero(g2,0);

file:///C/Users/franc/Downloads/RinottMatlab.txt[05/02/2021 11:41:33]

You might also like