library(bnlearn)
bnet = model2network("[A][C|A:B][D|A:C][B|A]") #A is the target variable while
#B, C and D are covariates
obsvA=data.frame(list(B=c("L","H","H","L","L"),C=c("H","H","L","L","H"),D=c("L","L","L","H","H")))
target_value= c("P","N")
prob= gen_emis(net=bnet,observation=obsvA,sym=target_value)
Run the code above in your browser using DataLab