seq_pa_ch_monitor {bnmonitor}R Documentation

Sequential parent-child node monitors

Description

Sequential node monitor for a vertex of a Bayesian network for a specific configuration of its parents

Usage

seq_pa_ch_monitor(dag, df, node.name, pa.names, pa.val, alpha = "default")

Arguments

dag

an object of class bn from the bnlearn package

df

a base R style dataframe

node.name

node over which to compute the monitor

pa.names

vector including the names of the parents of node.name

pa.val

vector including the levels of pa.names considered

alpha

single integer. By default, the number of max levels in df

Details

Consider a Bayesian network over variables Y1,,YmY_1,\dots,Y_m and suppose a dataset (y1,,yn)(\boldsymbol{y}_1,\dots,\boldsymbol{y}_n) has been observed, where yi=(yi1,,yim)\boldsymbol{y}_i=(y_{i1},\dots,y_{im}) and yijy_{ij} is the i-th observation of the j-th variable. Consider a configuration πj\pi_j of the parents and consider the sub-vector y=(y1,,yN)\boldsymbol{y}'=(\boldsymbol{y}_1',\dots,\boldsymbol{y}_{N'}') of (y1,,yn)(\boldsymbol{y}_1,\dots,\boldsymbol{y}_n) including observations where the parents of YjY_j take value πj\pi_j only. Let pi(πj)p_i(\cdot|\pi_j) be the conditional distribution of YjY_j given that its parents take value πj\pi_j after the first i-1 observations have been processed. Define

Ei=k=1Kpi(dkπj)log(pi(dkπj)),E_i = \sum_{k=1}^Kp_i(d_k|\pi_j)\log(p_i(d_k|\pi_j)),

Vi=k=1Kpi(dkπj)log2(pi(dkπj))Ei2,V_i = \sum_{k=1}^K p_i(d_k|\pi_j)\log^2(p_i(d_k|\pi_j))-E_i^2,

where (d1,,dK)(d_1,\dots,d_K) are the possible values of YjY_j. The sequential parent-child node monitor for the vertex YjY_j and parent configuration πj\pi_j is defined as

Zij=k=1ilog(pk(ykjπj))k=1iEkk=1iVk.Z_{ij}=\frac{-\sum_{k=1}^i\log(p_k(y_{kj}'|\pi_j))-\sum_{k=1}^i E_k}{\sqrt{\sum_{k=1}^iV_k}}.

Values of ZijZ_{ij} such that Zij>1.96|Z_{ij}|> 1.96 can give an indication of a poor model fit for the vertex YjY_j after the first i-1 observations have been processed.

Value

A vector including the scores ZijZ_{ij}.

References

Cowell, R. G., Dawid, P., Lauritzen, S. L., & Spiegelhalter, D. J. (2006). Probabilistic networks and expert systems: Exact computational methods for Bayesian networks. Springer Science & Business Media.

Cowell, R. G., Verrall, R. J., & Yoon, Y. K. (2007). Modeling operational risk with Bayesian networks. Journal of Risk and Insurance, 74(4), 795-827.

See Also

influential_obs, node_monitor, seq_node_monitor, seq_pa_ch_monitor

Examples

seq_pa_ch_monitor(chds_bn, chds, "Events", "Social", "High", 3)


[Package bnmonitor version 0.2.0 Index]