On Sun, 14 Nov 2021, 18:58 Phil Steitz, <phil.ste...@gmail.com> wrote:
> > > 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. The point is that this never occurs. This feature is only tested using a mock distribution that requires it. The feature can always be added back if a distribution requires it in the future. But currently there are no such distributions. Alex . > > 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 > > >