by ppcsf · 10y ago · 0 comments
var combined = from isAmerican in Bernoulli(0.25)
from grade in isAmerican ? americanGrades : indianGrades
select grade;
This is now a new model that can be composed further with other models. Building models like this feels very expressive.The inference method is also completely decoupled from the model specification process, allowing us to perform a Sequential Monte Carlo just by writing:
var smcResults = combined.SmcMultiple(100);
or var pimhResults = combined.Pimh(10);
for a Particle-Independant Metropolis-Hastings.There's more examples here: https://github.com/joashc/csharp-probability-monad
No comments yet.