| 2912 | } |
| 2913 | |
| 2914 | double 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 | |
| 2932 | double Result::sum(Measure m) const noexcept { |
| 2933 | auto const& data = mNameToMeasurements[detail::u(m)]; |
no test coverage detected