webppl icon indicating copy to clipboard operation
webppl copied to clipboard

Document the `samples` property of sample based marginals

Open null-a opened this issue 7 years ago • 2 comments

null-a avatar Dec 05 '16 09:12 null-a

Would it be best to add a return statement to all the inference methods and document the return types as list of samples backed marginals?

jpchen avatar Jan 14 '17 08:01 jpchen

This seems like a good way to go for this specific issue, and I too had this approach in mind. However, I wonder if this might break down when we get around to documenting some of the other properties that appear on marginal distributions. The problem I see is that these other properties are ad-hoc, tacked onto the marginal distribution rather than been part of the 'type', so documenting the return type won't be sufficient. I wonder whether for the purposes of documentation it might be better to ignore the fact that there is more than one marginal type, and instead describe all properties (including samples) as though they were ad-hoc?

I suppose one way to do this would be to simply list the additional properties that each method adds to the marginal as part of the description of the method. Maybe this could sit next to the return type, something like:

Returns: Marginal distribution (Additional properties: samples.)

Maybe that could link to a new section that givens a description of each property, so we avoid duplicating that as part of each method description?

null-a avatar Jan 18 '17 10:01 null-a