Learn R Programming

dagHMM (version 0.1.1)

gen_emis: Generating the inital emission probability distribution of the covariates in TAN structure.

Description

Generating the inital emission probability distribution of the covariates in TAN structure.

Usage

gen_emis(net, observation, sym)

Value

Inital emission probability distribution of the covariates in TAN structure

Arguments

net

Object of type 'bn' provided as output by model2network showing the TAN structure between target variable and covariates.

observation

Dataframe containing the discritized character values of only covariates at each node. Column names of dataframe should be same as the covariate names. Missing values should be denoted by "NA".

sym

Character vector of possible values of target variable

Examples

Run this code

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