How can I calculate the probability of false detection?
Hello everyone!
I need to justify for my dissertation the problems of false detection of a signal by a normal distribution (Gaussian) and build a graph where I should get a decreasing exponent in the interval for P from 10^-8 to 10^-1, and for alpha squared (alpha^2) from 10 to 100. The sigma dispersion = from 10 to 100. The threshold value of the signal n2 = 1.5, from which the normal value is integrated to infinity to calculate the probability of P.
I wrote the following code:
% Given parameters
sigma2_values = linspace (0.1, 0.01, 100); % dispersion values from 0.01 to 1000
n2 = 1.5; % threshold value
P_loznoe = zeros(length(sigma2_values), 1); % Initialize array for P_false
% Calculate P_false for each value of sigma^2 for fixed n2
for j = 1: length(sigma2_values)
sigma2 = sigma2_values(j); % use current value of sigma^2
alpha2 = 1/sigma2; % Calculate alpha^2
% Calculate integral of P(x) from n2 to infinity
integrand = @(x) (1 / (sqrt(2 * pi * sigma2))) .* exp(-((x.^2) / (2 * sigma2)));
P_loznoe(j) = integral(integrand, n2, Inf); % Calculate the integral
end
% Calculate alpha^2 for each sigma^2
alpha2_values = 1 ./sigma2_values; % alpha^2 = 1/sigma^2
% Plot P_false vs. alpha^2
figure;
semilogy(alpha2_values, P_loznoe, ‘r’, ‘LineWidth’, 2); % Logarithmic scale on the Y axis
title(‘False discovery rate vs. alpha^2’);
xlabel(‘alpha^2’);
ylabel(‘P_{false}’);
xlim([10 100]); % Set limits on the X axis
ylim([10^(-8) 10^(-1)]); % Set limits on the Y axis to expand the grid
grid on; % Grid on
But for some reason my graph is not in the specified interval and not in the form of a decreasing exponent, but in the form of a linear decrease.
How can this be fixed?
Thanks in advance!Hello everyone!
I need to justify for my dissertation the problems of false detection of a signal by a normal distribution (Gaussian) and build a graph where I should get a decreasing exponent in the interval for P from 10^-8 to 10^-1, and for alpha squared (alpha^2) from 10 to 100. The sigma dispersion = from 10 to 100. The threshold value of the signal n2 = 1.5, from which the normal value is integrated to infinity to calculate the probability of P.
I wrote the following code:
% Given parameters
sigma2_values = linspace (0.1, 0.01, 100); % dispersion values from 0.01 to 1000
n2 = 1.5; % threshold value
P_loznoe = zeros(length(sigma2_values), 1); % Initialize array for P_false
% Calculate P_false for each value of sigma^2 for fixed n2
for j = 1: length(sigma2_values)
sigma2 = sigma2_values(j); % use current value of sigma^2
alpha2 = 1/sigma2; % Calculate alpha^2
% Calculate integral of P(x) from n2 to infinity
integrand = @(x) (1 / (sqrt(2 * pi * sigma2))) .* exp(-((x.^2) / (2 * sigma2)));
P_loznoe(j) = integral(integrand, n2, Inf); % Calculate the integral
end
% Calculate alpha^2 for each sigma^2
alpha2_values = 1 ./sigma2_values; % alpha^2 = 1/sigma^2
% Plot P_false vs. alpha^2
figure;
semilogy(alpha2_values, P_loznoe, ‘r’, ‘LineWidth’, 2); % Logarithmic scale on the Y axis
title(‘False discovery rate vs. alpha^2’);
xlabel(‘alpha^2’);
ylabel(‘P_{false}’);
xlim([10 100]); % Set limits on the X axis
ylim([10^(-8) 10^(-1)]); % Set limits on the Y axis to expand the grid
grid on; % Grid on
But for some reason my graph is not in the specified interval and not in the form of a decreasing exponent, but in the form of a linear decrease.
How can this be fixed?
Thanks in advance! Hello everyone!
I need to justify for my dissertation the problems of false detection of a signal by a normal distribution (Gaussian) and build a graph where I should get a decreasing exponent in the interval for P from 10^-8 to 10^-1, and for alpha squared (alpha^2) from 10 to 100. The sigma dispersion = from 10 to 100. The threshold value of the signal n2 = 1.5, from which the normal value is integrated to infinity to calculate the probability of P.
I wrote the following code:
% Given parameters
sigma2_values = linspace (0.1, 0.01, 100); % dispersion values from 0.01 to 1000
n2 = 1.5; % threshold value
P_loznoe = zeros(length(sigma2_values), 1); % Initialize array for P_false
% Calculate P_false for each value of sigma^2 for fixed n2
for j = 1: length(sigma2_values)
sigma2 = sigma2_values(j); % use current value of sigma^2
alpha2 = 1/sigma2; % Calculate alpha^2
% Calculate integral of P(x) from n2 to infinity
integrand = @(x) (1 / (sqrt(2 * pi * sigma2))) .* exp(-((x.^2) / (2 * sigma2)));
P_loznoe(j) = integral(integrand, n2, Inf); % Calculate the integral
end
% Calculate alpha^2 for each sigma^2
alpha2_values = 1 ./sigma2_values; % alpha^2 = 1/sigma^2
% Plot P_false vs. alpha^2
figure;
semilogy(alpha2_values, P_loznoe, ‘r’, ‘LineWidth’, 2); % Logarithmic scale on the Y axis
title(‘False discovery rate vs. alpha^2’);
xlabel(‘alpha^2’);
ylabel(‘P_{false}’);
xlim([10 100]); % Set limits on the X axis
ylim([10^(-8) 10^(-1)]); % Set limits on the Y axis to expand the grid
grid on; % Grid on
But for some reason my graph is not in the specified interval and not in the form of a decreasing exponent, but in the form of a linear decrease.
How can this be fixed?
Thanks in advance! gauss MATLAB Answers — New Questions