You can plot the ROC curve and evaluate classifier performance for radar data using the ‘perfcurve’ function. The ‘perfcurve’ function returns the properties of an ROC curve for a vector of classifier predictions, scores, given true class labels, labels, and the positive class label. The computed values from the function can then be used to visualize the ROC curve using the ‘plot’ function.
The following steps can be used to plot the ROC curve:
- Create a matrix of predictor variables and define the binary response variable:
labels = [ones(30,1); zeros(25,1)];
- Use a suitable classifier that can output scores or probabilities. Following is an example with logistic regression:
mdl = fitglm(X, Y, 'Distribution', 'binomial', 'Link', 'logit');
scores = mdl.Fitted.Probability;
- Compute the parameter of the ROC curve using the ‘perfcurve’ function:
[X_out, Y_out, T, AUC] = perfcurve(labels, scores, 1);
xlabel('False Positive Rate');
ylabel('True Positive Rate');
The following output ROC curve is received by following the given steps:
To find the probability of false alarm (PFA) at a desired level, you can search the ROC curve for the closest false positive rate to your target. You can find the PFA using the following code snippet:
[~, idx] = min(abs(X_out - desiredPFA));
Since, you have the SNR data, you can consider using the ‘rocsnr’ to calculate the PFA:
[~, idx] = min(abs(Pd - desiredPd));
pfa_at_desiredPd = Pfa(idx);
Please refer to the following documentations to get more information on the related functions:
I hope this helps!