I added a truncated distribution that takes a distribution and returns another distribution that is truncated to a given range. I mostly wanted it for a truncated normal, but thought I may as well make it more general.
I wrote some tests for it. They seem to work, other than the chi-squared.
I have added some comments documenting the parameters for which I get the failure.
Not sure where the real problem is. There could be a problem in cdf/quantile for chi-squared.
Or, it could be that I just need to restrict the range of parameters used in the test, so that the values stay within a reasonable range. If so, please let me know and I will make the changes.
I added a truncated distribution that takes a distribution and returns another distribution that is truncated to a given range. I mostly wanted it for a truncated normal, but thought I may as well make it more general.
I wrote some tests for it. They seem to work, other than the chi-squared. I have added some comments documenting the parameters for which I get the failure. Not sure where the real problem is. There could be a problem in cdf/quantile for chi-squared. Or, it could be that I just need to restrict the range of parameters used in the test, so that the values stay within a reasonable range. If so, please let me know and I will make the changes.
Would you please take a look? Thanks