Description Usage Arguments Details Examples
Given a distance matrix from calcVinEll
, calculate a
stochastic matrix where one step movement probabilities follow a gamma density.
1 | calcGammaKernel(distMat, shape, rate)
|
distMat |
Distance matrix from |
shape |
Shape parameter of |
rate |
Rate parameter of |
The distribution and density functions for the gamma kernel are given below:
F(x)=\frac{1}{Γ(α)}γ(α,β x)
f(x)=\frac{β^{α}}{Γ(α)}x^{α-1}e^{-β x}
where Γ(α) is the Gamma function, γ(α,β x) is the lower incomplete gamma function, and α,β are the shape and rate parameters, respectively.
1 2 3 4 5 6 7 8 9 10 11 | # setup distance matrix
# two-column matrix with latitude/longitude, in degrees
latLong = cbind(runif(n = 5, min = 0, max = 90),
runif(n = 5, min = 0, max = 180))
# Vincenty Ellipsoid distance formula
distMat = calcVinEll(latLongs = latLong)
# calculate gamma distribution over distances
# shape and rate are just for example
kernMat = calcGammaKernel(distMat = distMat, shape = 1, rate = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.