In the last line below, what role does “Weights” play? It’s not an argument to scoreDistribution yet without “Weights”, the code fails. Its role baffles me. Thanks.
Unfortunately my response is probably more commiserating than helpful. I found that the resulting object from scoreDistribution is a DataDistribution object of dimension 4 with a few other named properties (although I didn’t get the function above to work exactly as written):
In[34]:= n = 100;
sides = 2;
pgf = Cancel[
FactorialMomentGeneratingFunction[
DiscreteUniformDistribution[{1, sides}], z]/z]^n;
w = EmpiricalDistribution[
CoefficientList[pgf, z] -> Range[n, n sides]];
Dimensions[w]
w["Type"]
w[[1]]
w["Domain"] == w[[2]][[2]]
w["Dimension"] == w[[3]]
w["Weights"] == w[[2]][[1]]
w[[4]] (* Number of elements in the sample space *)
Out[38]= {4}
Out[39]= EmpiricalDistribution
Out[40]= "Empirical"
Out[41]= True
Out[42]= True
Out[43]= True
Out[44]= 101
I didn’t figure out the associated name with w[[4]] (the number of data points).
Correction: Simpler than I thought to get the properties.