Hello,
I'm trying to figure out which sampling algorithm to use but I'm getting some confusing results. I'm using constants.h to figure out which algorithm is used by using setBayesianAlgorithm.
First off I need to use srand() to set the seed, so I can't use 7 and 8 since they seem to use their own random number generators. Algorithm 9 doesn't seem to work and Algorithm 4 is returning a biased answer based on the exact solution.
For sampling this leaves 1 (Henrion), 3 (LSampling), 5 (HeuristicImportance), and 6 (BackSampling). The strange thing is they all return the same result for my experiment. My experiment is computing the utility of the best decision in an ID. Is there a reason they are all return the same answer as I vary my seed?
Thanks,
Chris
Which Sampling Algorithm
-
- Posts: 6
- Joined: Wed May 13, 2015 9:59 pm
Re: Which Sampling Algorithm
Hello,
I've partially answered my own question. One needs to set evidence to get the sampling to give different answers. Setting evidence gives me different answers for 1 and 6 but 3 and 5 are still the same. Anyway based on skimming some of the literature, it seems that algorithm 3, which I assume is likelyhood weighting, is a good default choice.
Thanks,
Chris
I've partially answered my own question. One needs to set evidence to get the sampling to give different answers. Setting evidence gives me different answers for 1 and 6 but 3 and 5 are still the same. Anyway based on skimming some of the literature, it seems that algorithm 3, which I assume is likelyhood weighting, is a good default choice.
Thanks,
Chris
-
- Site Admin
- Posts: 1417
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Which Sampling Algorithm
We recommend the EPIS sampling (DSL_ALG_BN_EPISSAMPLING).
-
- Posts: 6
- Joined: Wed May 13, 2015 9:59 pm
Re: Which Sampling Algorithm
Hello,
I'd like to use EPIS since it gives the best performance in my limited experiments. (Twice as fast as likelyhood weighting.) However, I want to run it on different machines and average the results. For this I need to know that the seeds used are different. I'm guessing the seed used is based on the clock. What part of the clock is used to seed the algorithm. If it's using milliseconds or less I might be OK.
Thanks,
Chris
I'd like to use EPIS since it gives the best performance in my limited experiments. (Twice as fast as likelyhood weighting.) However, I want to run it on different machines and average the results. For this I need to know that the seeds used are different. I'm guessing the seed used is based on the clock. What part of the clock is used to seed the algorithm. If it's using milliseconds or less I might be OK.
Thanks,
Chris
-
- Site Admin
- Posts: 1417
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Which Sampling Algorithm
EPIS uses a seed based on outputs from time() and clock() functions.mesterharm wrote:What part of the clock is used to seed the algorithm. If it's using milliseconds or less I might be OK.
-
- Posts: 6
- Joined: Wed May 13, 2015 9:59 pm
Re: Which Sampling Algorithm
That's great; it's easy to ensure that clock() will give me different seeds.EPIS uses a seed based on outputs from time() and clock() functions.
Thanks for the quick reply.
Chris