Update tests for triangular.pdf
Update tests for triangular.pdf

Updating and adding tests for triangular.pdf(). One of the previous
tests was:
assert.epsilon(tol, jStat.triangular.pdf(1.0, 1.0, 2.0, 1.0), 1.0);
This test was failing, however the test is incorrect. A comment in the
test code claimed that this test was based on R's dtriangle(x, a, b, c)
from package 'triangle', however this is not consistent with the current
return value for the R code:
> dtriangle(1, 1, 2, 1)
[1] NaN
Warning message:
In dTest(c(x, a, b, c)) :
values required to be  a <= c <= b (at least one strict inequality)

To further confuse matters, dtriangle() clearly has a bug in it, given
that NaN is not the correct value for this case, and the provided
warning is not even consistent with the passed parameters!

So I am now using R's dtriang() from package mc2d as my reference, as it
appears to be a better implementation of the triangular distribution.

I have added the reference R code into the comment in the test file,
since if we are going to refer to R functions for tests, we might as
well make it easy for someone to confirm.

Furthermore, I have added more tests, in an attempt to get basic
coverage of the various segments of the triangular distribution for each
of the basic forms it can take.

PR-URL: https://github.com/jstat/jstat/pull/148
Reviewed-by: Trevor Norris <9cb5491eb5770dd8e0bf77a8a0335abf5f0488c5@gmail.com>

akrawitz/jstat,jstat/jstat,NorthDecoder/jstat,JeebsM/jstat,akrawitz/jstat,ggonzale/jstat,jstat/jstat,ggonzale/jstat,JeebsM/jstat,NorthDecoder/jstat