On 11/14/21 2:29 AM, Alex Herbert wrote:
Both the discrete and continuous distribution have a property in the interface:

     /**
      * Indicates whether the support is connected, i.e. whether
      * all values between the lower and upper bound of the support
      * are included in the support.
      *
      * @return whether the support is connected.
      */
     boolean isSupportConnected();

This is only ever true for all distributions.

Other stats libraries in Python, R, Matlab, Mathematica do not have
this property. The property is in commons Math3 and dates back 10
years to the package name change from Math2 to Math3. I did not chase
the commit history through SVN.

In Math3 only 5 real distributions and 1 discrete distribution test
this property. They all test it is true.

Interestingly the discrete distribution is the enumerated distribution
built from a set of discrete values. This may be a case for returning
false if certain values between the lower and upper range have a
probability of zero. But in this case it is valid behaviour to return
zero for the probability.

It may be that this property was intended to be used to determine if
the distribution would throw an exception for certain values between
the lower and upper range for the support. In the [Statistics] version
of the distributions no exceptions are thrown. The return will be
either an appropriate extreme (+/- infinity) or NaN. There is also no
facility to determine what values within the support are not valid. So
the property isSupportConnect alone cannot be used to determine if the
value you are interested in is part of the support. This would require
a isSupported(double x) method.

The reason it exists is to make the default inverse cum impl handle the case where there is a gap in support.  If you want to add the requirement that support is always connected, you can drop the code in the default inverse cum that does this.

Phil

I propose to remove this unused property from the distribution
interfaces prior to the initial 1.0 release to avoid this redundant
method.

Alex

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to