Closed pr0m1th3as closed 5 months ago
Integral requires the integrand functions to be vectorized such that it can pass an array of inputs and get an array of outputs. (Parallel processing the quadrature routine.). There is an "ArrayValued" option that will generally let you work with non vectorized functions, but there will be a performance penalty
Just pushed a change to address this issue. I don't don't have access to MATLAB at the moment. Can you confirm that the expected values are also true in MATLAB, before I close this issue?
load patients
[f, x] = ecdf (Weight);
f = f(1:5:end);
x = x(1:5:end);
pd = PiecewiseLinearDistribution (x, f);
t = truncate (pd, 130, 180);
mean (t) # it must be 152.311
std(t) # it must be 18.2941
var(t) # it must be 334.6757
closing as fixed
There is some issue with
mean
,std
, andvar
methods in truncated PiecewiseLinearDistribution objects. It seems to be related tointegral
built-in function throwing an error.