Failing test in Matlab R2008a:
>> stk_test stk_distrib_normal_crps
***** test
crps_exp = nan (n, 1);
if isoctave % Find the integral function
intfun = @quad;
else
intfun = @integral;
end
for k = 1:n
F = @(x)(stk_distrib_normal_cdf (x, mu(k), sigma(k)));
crps_exp_1 = intfun (@(x)( F(x) .^2), -Inf, x_obs(k));
crps_exp_2 = intfun (@(x)((1 - F(x)).^2), x_obs(k), +Inf);
crps_exp(k) = crps_exp_1 + crps_exp_2;
end
!!!!! test failed
Undefined function or method 'integral' for input arguments of type 'function_handle'.
You find attached a correcting patch, which replaces the function
integralby the use of the functiontrapz, introduced in Matlab before version R2006a.The new test works on Matlab R2013a and Octave version 4.2.1.
Remark: this ticket is linked to ticket #71.
Last edit: Julien Bect 2017-06-20
Oh, yes, I had forgotten about this other ticket.
The proper fix is then the one indicated there: turn the tests into deterministic unit tests (i.e. get rid of all the rand/randn in %!shared) and pre-compute the reference values.
Last edit: Julien Bect 2017-06-20
Can you do that, or do you want me to do it?
Here is the patch without generating random data. It follows the previously attached patch.
Changes are posted, see STK revision:
https://sourceforge.net/p/kriging/hg/ci/f9da32feb81b6843f5e34bcab0417886f0d62be7/
https://sourceforge.net/p/kriging/hg/ci/705e7ee459dcb4c13c1e258a944cd04b66baf05b/