influential_obs: Influential observations

View source: R/influential_obs.R

influential_obsR Documentation

Influential observations

Description

Influence of a single observation to the global monitor

Usage

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

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.

Value

A vector including the influence of each observation.

See Also

influential_obs, node_monitor, seq_node_monitor, seq_pa_ch_monitor

Examples

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


bnmonitor documentation built on June 7, 2023, 5:19 p.m.