Menu

#77 stk_distrib_normal_crps: Undefined function or method 'integral' in R2008a

2.5
closed
nobody
None
2017-06-27
2017-06-16
Julien Bect
No

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'.

Discussion

  • STROH

    STROH - 2017-06-20

    You find attached a correcting patch, which replaces the function integral by the use of the function trapz, 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
  • Julien Bect

    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
  • Julien Bect

    Julien Bect - 2017-06-20

    Can you do that, or do you want me to do it?

     
  • STROH

    STROH - 2017-06-20

    Here is the patch without generating random data. It follows the previously attached patch.

     
  • Julien Bect

    Julien Bect - 2017-06-27
    • status: open --> closed
     
Monday.com Logo