You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm finding that HydeNet is giving pretty inaccurate predictions for a very simple completely discrete network. I'm wondering if this is a bug.
Here's a reproducible example for a two node network. The network a single parent and a single "evidence" node child:
node1 --> evid
Where p(node1) = .50, p(evid|node1) = .80 and p(evid|~node1) = .50.
make_custom_cpt<-function(ps, dims, dim_names, data) {
# makes custom cpt in HydeNet formatoutput<-array(ps, dim=dims, dimnames=dim_names)
attr(output, "model") <-data
attr(output, "class") <- c("cpt","array")
return(output)
}
set.seed(42)
# first create some easily-calculated CPTsn1<- xtabs(~node1, data=data.frame(node1= c(rep("Yes",500), rep("No",500))))
n2<- make_custom_cpt(c(.80, .5, .2, .5), c(2,2), list(node1=c("Yes","No"), evid= c("Yes","No") ), NULL)
mynet<- HydeNetwork(list(n1, n2))
# predict conditioning on no evidence, and observing the evidencemodel1<- compileJagsModel(mynet, data=data.frame(evid=2))
post1<- HydeSim(model1,
variable.names= c("node1"),
n.iter=1e6
)
p_obs_evidence<- mean(as.numeric(post1$node1)) -1p_obs_evidence
The result is:
> p_obs_evidence
[1] 0.714207
But this is easy enough to solve analytically by hand, and it should be .615. So HydeSim() is getting P(node1|evidence) pretty seriously wrong. Is this a bug?
The text was updated successfully, but these errors were encountered:
I'm finding that HydeNet is giving pretty inaccurate predictions for a very simple completely discrete network. I'm wondering if this is a bug.
Here's a reproducible example for a two node network. The network a single parent and a single "evidence" node child:
node1 --> evid
Where p(node1) = .50, p(evid|node1) = .80 and p(evid|~node1) = .50.
The result is:
But this is easy enough to solve analytically by hand, and it should be .615. So HydeSim() is getting P(node1|evidence) pretty seriously wrong. Is this a bug?
The text was updated successfully, but these errors were encountered: