Hello all,
I have a hybrid network with equation nodes. I need the mean and standard deviation of an equation node. Therefore I looked in this topic.
http://support.bayesfusion.com/forum/vi ... tion#p3849
That is my code which refers to the topic above.
handle = net.FindNode("a");
DSL_valEqEvaluation* val =(DSL_valEqEvaluation*)(net.GetNode(handle)->Value());
if(net.GetNode(handle)->Value->IsValueValid())
{
double mean = val->GetSampleMean();
double stddev = val->GetSampleStdDev();
cout<<mean<<" "<<stddev<<endl;
}
The double values contain not a number and I don't get any error.
Best regards,
Sebastian
Getting nan using GetSampleMean() and GetSampleStdDev()
-
- Site Admin
- Posts: 1417
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Getting nan using GetSampleMean() and GetSampleStdDev()
If you have evidence set on a node with parents, the discretization occurs. In such case node value is represented by discretized beliefs, which you can acces through DSL_valEqEvaluation::GetDiscBeliefs. The method returns a reference to a vector. The vector is non-empty if node was discretized.
Note that discretization is done even if you did not specify the intervals - in such case two intervals are automatically generated.
Note that discretization is done even if you did not specify the intervals - in such case two intervals are automatically generated.