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

Marco Scutari marco.scutari at gmail.com
Fri Oct 11 22:25:33 CEST 2013


Dear Ryan,

On 11 October 2013 20:44, Ryan Morrison <ryan.r.morrison at me.com> wrote:
> Thanks for the clarification. For my immediate purposes I think using the likelihood
> weighting method will suffice. I'm calculating conditional probabilities based on a
> single instantiation each time I use the function. The evidence I use for instantiation
> changes for each i+1 in my loop, and a new probability is computed using the new
> evidence. Since I'm using a single instantiation of the conditioning variables for each
> calculation in my loop, I believe the likelihood weighting method will work. Don't
> hesitate to correct me if I'm wrong.

>From your description, likelihood weighting should be fine.

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