montecarlo.pl

 montecarlo(+File:file, :Query:atom, -Probability:float, +Options:list) is det
Start a Monte Carlo sampling process.

The predicate assumes that File designates a PLP object program, which is consulted and transformed into an equivalent standard prolog program. The predicate then samples Query either a fixed number of times or until a confidence value (as detailed in Riguzzi 2013, p. 6) reaches a configured threshold and returns the sampled Probability of the query being true.

Non-ground queries are treated as existential queries, unless the per_grounding option flag has explicitly been set to true (value != 0).

Options is a list configuring the sampling process. Available options:

sampler(+SamplerParams:list)
First parameter is either standard or gibbs. When using Gibbs sampling, a second parameter controls the block size of variables sampled together.
confidence(+Confidence:float)
Configures the amount of samples taken by defining an expected target accuracy for the result. Set to a value other than a positive float to instead take a fixed amount of samples.
count(+Count:int)
Amount of samples taken. (confidence unset -> in total; confidence set -> at once between calulating confidence values)
per_grounding(+PerGrounding:int)
When providing non-ground queries, compute the probabilities per individual grounding, instead of treating it as an existential query (if value != 0).
silent(+Silent:int)
Suppress logging of informational output (if value != 0).
 montecarlo(+File:file, :Query:atom, -Probability:float) is det
Alias of montecarlo/3 with empty options.