aldg: Function to compute the aLDG measure

View source: R/corr.R

aldgR Documentation

Function to compute the aLDG measure

Description

Function to compute the aLDG measure

Usage

aldg(
  x,
  y,
  sx = NULL,
  sy = NULL,
  thred = -Inf,
  hx = NULL,
  hy = NULL,
  wd = 1,
  cutoff = 1,
  chooset = "error",
  trials = 5
)

Arguments

hx, hy:

(aLDG specific parameters) vector consist provided bandwidth for x (or y), default to NULL

x:

a numeric vector

y:

a numeric vector of the same length as x

sx:

a list containing the sorting information, defualt to NULL, if not NULL, then should have the format sx = list(rank = vector of value rank, dist = matrix of pairwise distance)

sy:

similar as the definition for sx, but for vector y

thred:

(aLDG specific parameters) only the data > thred will be used for aLDG

band:

(aLDG specific parameters) which method to use for automatically calculating bandwidth (if hx and hy are NULL) – 'fix': the window around x is B_x = (x-wd \cdot h_n, x + wd \cdot h_n – 'ada': the adaptive window around x is P(X \in B_x \mid Y=y) = qd

wd:

(aLDG specific parameters) the coefficient before the bandwidth h = wd*h_n

qd:

(aLDG specific parameters) the quantile window to compute the adaptive bandwidth h_x = sd(x(qd))

opt:

(aLDG specific parameters) for 'fix' bandwidth calculation, if TRUE, we use the theoretical optimal rate h_n = sd(x) n^{-1/6}; if FALSE, we use h_n = sd

stat:

(aLDG specific parameters) what statistics to use for T_i in aLDG

cutoff:

(aLDG specific parameters) the coef c in threshold choice for aLDG:

aLDG = \frac{1}{n} ∑_{i=1}^n ( T_i > \frac{Φ^{-1}(1-n^{-c})}{n^{1/3}})

Value

a vector

Examples

# Load example data
ans = aldg(runif(10),runif(10))
print(ans$aldg)

JINJINT/aLDG documentation built on April 1, 2022, 6:23 p.m.