plotshift_dens: Density based graphical identifiability diagnostics and...

View source: R/base_identify.R

plotshift_densR Documentation

Density based graphical identifiability diagnostics and visualization

Description

Plot a sorted estimated density function of pre- and post-stochastic-intervention values of a predictor. The closer the two functions are for pre- and post-intervention will typically mean that the stochastic intervention is better identified for a given column of the predictor matrix. This plot will generally give a useful way to visualize the implied stochastic intervention and may diagnose some issues with the intervention. This can also help diagnose issues with modeling inverse probability weights, when the estimated density is close to zero over a large portion of the data.

Usage

plotshift_dens(vibr_fit, Acol = 1, delta, ...)

Arguments

vibr_fit

a fit from varimp

Acol

(integer) which column of predictors in call to varimp to diagnose

delta

(numeric, default=0.01) change in each column of predictors in call to varimp corresponding to stochastic intervention

...

not used

Value

ggplot2 plot object

Examples

## Not run: 
data(metals, package="qgcomp")
# subset of predictors
XYlist = list(X=metals[,1:4], Y=metals$y)
Y_learners = .default_continuous_learners()
Xbinary_learners = list(Lrnr_stepwise$new(name="SW"))
Xdensity_learners = .default_density_learners(n_bins=c(10))
set.seed(1231)
vi_ipw <- varimp(X=XYlist$X,Y=XYlist$Y, delta=0.1, Y_learners = Y_learners,
       Xdensity_learners=Xdensity_learners[1:2], Xbinary_learners=Xbinary_learners,
       estimator="TMLE")
plotshift_dens(vi_ipw, Acol=1, delta=0.01)

## End(Not run)

alexpkeil1/vibr documentation built on Sept. 13, 2023, 3:20 a.m.