Description Usage Arguments Value Examples
Fit a bnet object
1 |
object |
a bnet obejct |
data |
data.frame with names that include the variables of |
... |
additional parameters to be passed to the bmop fitting functions |
search |
logical, use penalized loglik search or not |
a bnet object with fitted densities and conditional densities
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run: require(bnlearn)
data(gaussian.test)
bn<-hc(gaussian.test,maxp=2)
plot(bn)
bnet<-as.bnet(bn)
plot(bnet)
is.fitted.bnet(bnet)
bnet<-fit.bnet(bnet,gaussian.test[1:100,]) # just 100 observation
are used to make computation lighter
is.fitted.bnet(bnet)
plot(bnet$variables$A$prob)
plot(bnet$variables$B$prob)
## End(Not run)
X<-rnorm(100)
Y<-rnorm(100)
U<-rnorm(100,mean=X+Y)
V<-rnorm(100,mean=X)
Z<-rnorm(100,mean=U)
data<-data.frame(X,Y,U,V,Z)
mat<-matrix(nrow=5, c(0,0,1,1,0,
0,0,1,0,0,
0,0,0,0,1,
0,0,0,0,0))
bnet<-new_bnet(names(data),mat)
bnet<-fit.bnet(bnet,data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.