Optimising a function with multiple inputs
Show older comments
Hi everyone.
I have written a function to detect outliers in data sets based on tresholds defined by relative and absolute tolerances (tol_tr, tol_ta)
[outlier_detected]= find_out(outlied_n, TLE1.Frac_year, gap_start1, gap_end1,sample,tol_tr,tol_ta);
f_n = length(setdiff(x_out,out_detected))/nr_out; % normalized quantity of false negatives
f_p =length(setdiff(out_detected,x_out))/(length(outlied_n)-nr_out); % normalized quantity of false positives
rad=sqrt(f_n^2+f_p^2); % distance from origin
An outlier is detected if two quantities inside the find_out function are above the tol_tr and tol_ta. f_n is the quantity of missed outlier and f_p is the quantity of false outliers.I want to find the best tol_tr and tol_ta, to minimise the f_n and f_p. The best solution is the one closer to origin, so rad is expected to be minimized. Would be thankful for some help
Answers (0)
Categories
Find more on Chemistry in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!