MCPcopy Create free account
hub / github.com/ElementsProject/elements / medianAbsolutePercentError

Method medianAbsolutePercentError

src/bench/nanobench.h:2914–2930  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2912}
2913
2914double Result::medianAbsolutePercentError(Measure m) const {
2915 // create copy
2916 auto data = mNameToMeasurements[detail::u(m)];
2917
2918 // calculates MdAPE which is the median of percentage error
2919 // see https://www.spiderfinancial.com/support/documentation/numxl/reference-manual/forecasting-performance/mdape
2920 auto med = calcMedian(data);
2921
2922 // transform the data to absolute error
2923 for (auto& x : data) {
2924 x = (x - med) / x;
2925 if (x < 0) {
2926 x = -x;
2927 }
2928 }
2929 return calcMedian(data);
2930}
2931
2932double Result::sum(Measure m) const noexcept {
2933 auto const& data = mNameToMeasurements[detail::u(m)];

Callers 2

nanobench.hFile · 0.80
showResultMethod · 0.80

Calls 2

uFunction · 0.85
calcMedianFunction · 0.85

Tested by

no test coverage detected