Observe:
(* create a simple sum of DUs distribution *)
dist = TransformedDistribution[
a + b, {a \[Distributed] DiscreteUniformDistribution[{1, 6}],
b \[Distributed] DiscreteUniformDistribution[{1, 6}]}];
(* get the CDF of that, make my own PD for kicks *)
cdf = CDF[dist, x];
myPD = ProbabilityDistribution[{"CDF", cdf}, {x, 2, 12, 1}];
(* verify - mine and intrinsic are equivalent *)
PDF[myPD, Range[2, 12]] == PDF[dist, Range[2, 12]]
CDF[myPD][Range[2, 12]] == CDF[dist][Range[2, 12]]
(* poop out some RV based on intrinsic *)
rv = RandomVariate[dist, 360];
(* do a fit test on intrinsic, then mine *)
DistributionFitTest[rv, dist, "PearsonChiSquare"]
DistributionFitTest[rv, myPD, "PearsonChiSquare"]
(*
True
True
Indeterminate
0.476108
*)
Any ideas why Indeterminate
results? I do note that doing
PDF[dist, {6, 7}]
PDF[myPD, {6, 7}]
gives correct results, but doing
CDF[dist, {6, 7}]
CDF[myPD, {6, 7}]
gives proper results for myPD
, but a steaming mess for dist
...
On MMA 9.01/Windows, btw.
bug
tag might be appropriate? $\endgroup$