Learn R Programming

bnmonitor (version 0.2.2)

influential_obs: Influential observations

Description

Influence of a single observation to the global monitor

Usage

influential_obs(dag, data, alpha = "default")

Value

A vector including the influence of each observation.

Arguments

dag

an object of class bn from the bnlearn package

data

a base R style dataframe

alpha

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

Details

Consider a Bayesian network over variables \(Y_1,\dots,Y_m\) and suppose a dataset \((\boldsymbol{y}_1,\dots,\boldsymbol{y}_n)\) has been observed, where \(\boldsymbol{y}_i=(y_{i1},\dots,y_{im})\) and \(y_{ij}\) is the i-th observation of the j-th variable. Define \(\boldsymbol{y}_{-i}=(\boldsymbol{y}_1,\dots,\boldsymbol{y}_{i-1},\boldsymbol{y}_{i+1},\dots,\boldsymbol{y}_n)\). The influence of an observation to the global monitor is defined as $$|\log(p(\boldsymbol{y}_1,\dots,\boldsymbol{y}_n)) - \log(p(\boldsymbol{y}_{-i}))|.$$ High values of this index denote observations that highly contribute to the likelihood of the model.

See Also

influential_obs, node_monitor, seq_node_monitor, seq_pa_ch_monitor

Examples

Run this code
influential_obs(chds_bn, chds[1:100,], 3)

Run the code above in your browser using DataLab