Commit 8794737a authored by Ferdinand Fischer's avatar Ferdinand Fischer
Browse files

Added hypothesis test to WhiteGaussianNoise

parent 03d1500e
......@@ -117,6 +117,34 @@ classdef WhiteGaussianNoise
p = 2 * P.at(abs(z - obj.mue)) - 1;
end
end
end
methods ( Static )
function P = stochasticHypothesis(f_hat, threshold, startIdx)
%STOCHASTICHYPOTHESIS testing the stochastic hypothesis
% P = StochasticHypothesis(f_hat, THRESHOLD, STARTIDX) computes
% the rate of the values |f_hat| which are smaller than the
% THRESHOLD. The parameter STARTIDX defines the first index of
% f_hat, which should be considered for the evaluation.
arguments
f_hat;
threshold;
startIdx = 1;
end
f_hat = abs(f_hat);
f_test = f_hat(startIdx:end);
total_values = numel(f_test);
values_smaller_fB = numel(find(f_test <= threshold));
P = values_smaller_fB/total_values;
end
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment