Replies: 2 comments
-
Hi Zeliha (@zelihay), Can you show an example where VOI seems to be incorrect? Let me show you another way to implement it (more compact) : def VOI(model,node_name,verbose=True):
def getMEU(evidence):
limid = gum.ShaferShenoyLIMIDInference(model)
limid.setEvidence(evidence)
limid.makeInference()
meu=limid.MEU()['mean']
if verbose:
print(f"Inference with {evidence=} : {meu}")
return meu
limid = gum.ShaferShenoyLIMIDInference(model)
limid.makeInference()
posterior=limid.posterior(node_name)
baseline=limid.MEU()['mean']
if verbose:
print(f"{baseline=}")
averageMEU=posterior.expectedValue(getMEU)
if verbose:
print(f"{averageMEU=}")
voi=averageMEU-baseline
if verbose:
print(f"{voi=}")
return voi |
Beta Was this translation helpful? Give feedback.
-
Hi Mr. Wuillemin, Sorry for the late reply. Thanks a lot for your time to provide the function. It is much shorter and more to the point. :) In case you would like to see the model that gives 0 voi for all chance nodes, here are the codes: Thanks again. Zeliha
|
Beta Was this translation helpful? Give feedback.
-
Hello:)
Thank you for the pyAgrum package, which I am using extensively for my dissertation.
I am currently working on creating a function to calculate the value of information (VoI), which supposed to be straightforward. I created two versions of the functions; 1) adding or removing the arc between the chance node and the decision node, and 2) calculating marginal probabilities and expected utility values with evidence, and I applied them on a toy model. They calculated voi correctly and gave the same result, which is the same with manual calculation.
However, when I applied them to a relatively large model, the VoI often turns out to be zero or negative. I am in doubt whether those chance nodes are insignificant and the VoI calculations are correct, or if there is an issue with the functions.
Is there anyone who might be interested take a look at the codes, below?
Many thanks:)
Zeliha
Beta Was this translation helpful? Give feedback.
All reactions