WPVI | R Documentation |
This function will measure how much removing each covariate harms prediction accuracy.
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
)
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: |
p |
Power of Wasserstein distance |
ground_p |
Power of distance metric |
transport.method |
Transport methods. See |
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 |
Returns an integer vector ranking covariate importance from most to least important.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.