permtest {xnet} | R Documentation |
Calculate the relative importance of the edges
Description
This function does a permutation-based evaluation of the impact of different edges on the final result. It does so by permuting the kernel matrices, refitting the model and calculating a loss function.
Usage
permtest(x, ...)
## S3 method for class 'permtest'
print(x, digits = max(3L, getOption("digits") - 3), ...)
## S4 method for signature 'tskrrHeterogeneous'
permtest(
x,
n = 100,
permutation = c("both", "row", "column"),
exclusion = c("interaction", "row", "column", "both"),
replaceby0 = FALSE,
fun = loss_mse,
exact = FALSE
)
## S4 method for signature 'tskrrHomogeneous'
permtest(
x,
n = 100,
permutation = c("both"),
exclusion = c("interaction", "both"),
replaceby0 = FALSE,
fun = loss_mse,
exact = FALSE
)
## S4 method for signature 'tskrrTune'
permtest(x, permutation = c("both", "row", "column"), n = 100)
Arguments
x |
either a |
... |
arguments passed to other methods |
digits |
the number of digits shown in the output |
n |
the number of permutations for every kernel matrix |
permutation |
a character string that defines whether the row, column or both kernel matrices should be permuted. Ignored in case of a homogeneous network |
exclusion |
the exclusion to be used in the |
replaceby0 |
a logical value indicating whether |
fun |
a function (or a character string with the name of a
function) that calculates the loss. See also |
exact |
a logical value that indicates whether or not an exact p-value should be calculated, or be approximated based on a normal distribution. |
Details
The test involved uses a normal approximation. It assumes that under the null hypothesis, the loss values are approximately normally distributed. The cumulative probability of a loss as small or smaller than the one found in the original model, is calculated based on a normal distribution from which the mean and sd are calculated from the permutations.
Value
An object of the class permtest.
Warning
It should be noted that this normal approximation is an ad-hoc approach. There's no guarantee that the actual distribution of the loss under the null hypothesis is normal. Depending on the loss function, a significant deviation from the theoretic distribution can exist. Hence this functions should only be used as a rough guidance in model evaluation.
Examples
# Heterogeneous network
data(drugtarget)
mod <- tskrr(drugTargetInteraction, targetSim, drugSim)
permtest(mod, fun = loss_auc)