Description Usage Arguments Details Value Author(s) See Also Examples
Set of functions to compute spatial weights between probes.
1 2 3 4 | triangWeight(distance, win)
rectangWeight(distance, win)
gaussWeight(distance, win)
epWeight(distance, win)
|
distance |
Numeric vector specifying the distance of probes from the central probe. Negative values refer to probes upstream, positive values to probes downstream. |
win |
Integer specifying maximum size of window. |
The functions 'triangWeight', 'rectangWeight', 'epWeight' and 'gaussWeight' provide a triangular, rectangular, Epanechnikov and Gaussian weighting window, respectively. The weighting function can be specified by the 'weightingFunction' argument in the 'estimate' method.
This way it is also possible to use custom weighting functions. In general they have to be called the same way as the functions mentioned before and have to return a vector of weights of the same length as the argument 'distance'. For more details on how to use own weighting functions please refer to the vignette of this package.
Please note that the returned weights do not have to be normalized since this is done at the computation of the weighted cumulative density.
A numeric vector with weights for each probe in the window.
Julian Gehring
Maintainer: Julian Gehring <julian.gehring@fdm.uni-freiburg.de>
Package:
les-package
Class:
Les
Methods and functions:
Les
estimate
threshold
regions
ci
chi2
export
plot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | distance <- seq(-50, 50)
win <- 50
weight <- triangWeight(distance, win)
plot(distance, weight, type="l", main="triangWeight")
weight <- rectangWeight(distance, win)
plot(distance, weight, type="l", main="rectangWeight")
weight <- gaussWeight(distance, win)
plot(distance, weight, type="l", main="gaussWeight")
weight <- epWeight(distance, win)
plot(distance, weight, type="l", main="epWeight")
## simple example for a custom weighting function
ownWeighting <- function(distance, win) {
weight <- as.integer(abs(distance) < win)
return(weight)
}
|
Loading required package: fdrtool
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.