Open ngoodman opened 10 years ago
I think a better solution is to have hist and other viz routines (optionally) take a thunk (instead of a list of data points). This thunk is a data stream, so this hist routine repeatedly asks for the next data point and updates the histogram, until some special 'nomoredata' object is returned.
This will interface nicely with the switch from diverse query
forms to a unified conditional
formthat returns a thunk (that samples from the conditional distribution).
Writing down our discussion today: the new conditional
semantics might have performance issues, but it's an empirical question
Also, re new conditional
semantics: proposals for new versions of Javascript (ECMAscript 6) include support for iterators/generators.
Have a flag to or variant of mh-query and rejection-query that makes a histogram of samples and updates it on each sample. This can be done by extending probabilistic-js inference routines to take a listener function (which is called when a sample is taken), and then creating a listener that calls the _hist vizualization tool.