Pc_givena4nn: Probability of observing the ith nearest neighbour at...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Pc_givena4nn.R

Description

This function gives the probability of observing the ith nearest neighbour at distance c given the previous 4 nearest neighbour distances, $P(d_i >= x | d_(i-1), d_(i-2), d_(i-3), d_(i-4))$

Usage

1
Pc_givena4nn(i, c, a, k1, k2, N)

Arguments

i

numeric, which nearest neighbour to consider

c

vector, the distance at which the ith NN was observed

a

vector, the distance at which the (i-1)th NN was observed, a <= c

k1

vector, number of previous neighbhour at distance d_i

k2

vector, number of preivous neighbhours at distance d_(i-1)

N

numeric, size of the dataset

Details

The probability is calculated by ranking the data and assuming that the data lie on a torus. For details see D<c3><bc>mcke et al. "A novel test for independence derived from an exact distribution of ith nearest neighbours" (PLoS ONE 2014)

Value

Probability vector

Author(s)

Sebastian D<c3><bc>mcke duemcke@mpipz.mpg.de

See Also

P_cge_ale, P_ceq

Examples

1
Pc_givena4nn(10,2:7,1:6,rep(0,6),rep(1,6),20)

knnIndep documentation built on May 29, 2017, 4:26 p.m.

Search within the knnIndep package
Search all R packages, documentation and source code