% Partial correlations sim: is the numerator positive?

N = 100000; %number of corrs to draw

%generate correlations from uniform distribution 0 to 1.
rSH = rand(N,1);
rST = rand(N,1);
rHT = rand(N,1);

numerator = rSH - (rST .* rHT); %obtain numerator of formula

freqPos = sum(numerator > 0); %frequency of numerators > 0
proportionPos = freqPos/N; %proportion of numerators > 0

% numDist = (rST .* rHT);
% 
% mean(rSH);
% mean(numDist);
% median(numDist);