seq_pa_ch_monitor {bnmonitor}R Documentation

Sequential parent-child node monitors


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


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



an object of class bn from the bnlearn package


a base R style dataframe

node over which to compute the monitor


vector including the names of the parents of


vector including the levels of pa.names considered


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


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

E_i = ∑_{k=1}^Kp_i(d_k|π_j)\log(p_i(d_k|π_j)),

V_i = ∑_{k=1}^K p_i(d_k|π_j)\log^2(p_i(d_k|π_j))-E_i^2,

where (d_1,…,d_K) are the possible values of Y_j. The sequential parent-child node monitor for the vertex Y_j and parent configuration π_j is defined as

Z_{ij}=\frac{-∑_{k=1}^i\log(p_k(y_{kj}'|π_j))-∑_{k=1}^i E_k}{√{∑_{k=1}^iV_k}}.

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


A vector including the scores Z_{ij}.


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


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

[Package bnmonitor version 0.1.1 Index]