kernels: Kernels used in summarizing features

Description Usage Arguments Details Value See Also

Description

Kernels convert distance/ duration vectors to single numbers, with a certain weight for certain distances. In general, at 0 distance, these return a value of 1, and the value decreases as the distance increases, reaching 0 at the limit of the support.

Usage

1
2
3
4
5
kernel_gaussian(d, r = 100, reduce_fun = sum)

kernel_parabola(d, r = 100, reduce_fun = sum)

kernel_uniform(d, r = 100, reduce_fun = sum)

Arguments

d

The vector of distances/ durations.

r

The radius of interest for the kernel to aggregate data.

reduce_fun

The reduce function used to aggregate data.

Details

Gaussian kernel is a truncated gaussian, where r = 4*sigma (i.e., std. dev = r/4).The density which is truncated away is 1 - erf(2 sqrt(2)), which is approximately 0.0000633. Parabola kernel is parabolic, decreasing with distance within radius r, and returns 0 elsewhere. It is a scaled Epanechnikov kernel. Uniform kernel returns 1 within radius r, 0 elsewhere.

Value

numeric, function (usually sum) of kernel-weighted distances or durations

See Also

enrich_opq()


sodascience/osmenrich documentation built on July 9, 2021, 11:08 a.m.