Learn R Programming

ExtremeRisks (version 0.0.5)

schedastic.test: Test on the effect of concomitant covariate on the extremes of the response variable

Description

Given observed data, perform a Kolmogorov-Smirnov type test comparing the cumulative distribution function of the concomitant covariate, defined as \(X \mid Y > t\), with \(t\) being the threshold, against the cumulative distribution function of the random vector of covariate.

Usage

schedastic.test(data, k, M = 1000L, xg, ng, bayes = TRUE, C = 5L, alpha = 0.05)

Value

a list with components

  • Delta maximum observed distance between the empirical distribution functions of the concomitant and complete covariate

  • DeltaM vector of length M containing the sample of maximum distances between the empirical distribution function of the concomitant complete covariate

  • critical double, critical value for the test statistic, computed as the \((1-alpha)\) level empirical quantile of DeltaM

  • pval double, p-value

Arguments

data

design matrix of dimension n by 2 containing the complete data for the dependent variable (first column) and covariate (second column) in [0,1]

k

integer, number of exceedances for the generalized Pareto

M

integer, number of samples to draw from the posterior distrinution of the law of the concomitant covariate. Default: 1000

xg

vector of covariate grid of dimension ng by 1 containing a sequence between zero and the last value of the corresponding covariate

ng

length of covariate grid

bayes

logical indicating the bootstrap method. If FALSE, a frequentist bootstrap on the empirical cumulative distribution function of the concomitant covariate is performed. Default to TRUE

C

integer, hypermparameter entering the posterior distributyion of the law of the concomitant covariate. Default: 5

alpha

double, significance level for the critical value of the test, computed as the \((1-alpha)\) level empirical quantile of the sample of distances between the empirical cumulative distribution function of the concomitant and complete covariate. Default: 0.05