[R] Using "cpquery" function from bnlearn package inside loop

Marco Scutari marco.scutari at gmail.com
Fri Oct 11 21:25:53 CEST 2013


Dear Ryan,

On 11 October 2013 16:50, Ryan Morrison <ryan.r.morrison at me.com> wrote:
> The cpquery function is definitely easier to use given that my evidence is
> contained in lists.

For the record, this is not a general solution to the bug. It's true
that likelihood weighting (method = "lw") is easier to use in a
programmatic way, but it is much more limited in the events you can
use for conditioning. Logic sampling (method = "ls") accepts an
arbitrary R expression as a conditioning event; likelihood weighting
at the moment accepts only a single instantiation of the conditioning
variables.

Cheers,
    Marco

-- 
Marco Scutari, Ph.D.
Research Associate, Genetics Institute (UGI)
University College London (UCL), United Kingdom



More information about the R-help mailing list