WPVI {WpProj}R Documentation

p-Wasserstein Variable Importance

Description

[Experimental] This function will measure how much removing each covariate harms prediction accuracy.

Usage

WPVI(
  X,
  eta,
  theta,
  pred.fun = NULL,
  p = 2,
  ground_p = 2,
  transport.method = transport_options(),
  epsilon = 0.05,
  OTmaxit = 100,
  display.progress = FALSE,
  parallel = NULL
)

Arguments

X

Covariates

eta

Predictions from the estimated model

theta

Parameters from the estimated model.

pred.fun

A prediction function. must take variables x, theta as arguments: pred.fun(x,theta)

p

Power of Wasserstein distance

ground_p

Power of distance metric

transport.method

Transport methods. See transport_options() for more details.

epsilon

Hyperparameter for Sinkhorn iterations

OTmaxit

Maximum number of iterations for the Wasserstein method

display.progress

Display intermediate progress

parallel

a foreach backend if already created

Value

Returns an integer vector ranking covariate importance from most to least important.

Examples

n <- 128
p <- 10
s <- 99
x <- matrix(1, nrow = n, ncol = p )
beta <- (1:10)/10
y <- x %*% beta 
post_beta <- matrix(beta, nrow=p, ncol=s) 
post_mu <- x %*% post_beta

fit <-  WpProj(X=x, eta=post_mu, power = 2.0)
WPVI(X = x, eta = post_mu, theta = post_beta, transport.method = "hilbert")

[Package WpProj version 0.2.1 Index]