Description Usage Arguments Details Examples
Given a distance matrix from calcVinEll
,
calculate a stochastic matrix where one step movement probabilities follow a lognormal density.
1 | calcLognormalKernel(distMat, meanlog, sdlog)
|
distMat |
Distance matrix from |
meanlog |
Log mean of |
sdlog |
Log standard deviation of |
The distribution and density functions for the lognormal kernel are given below:
F(x)=\frac{1}{2} + \frac{1}{2} \mathrm{erf}[\frac{\mathrm{ln}x-μ}{√{2}σ}]
f(x)=\frac{1}{xσ√{2π}}\mathrm{exp}≤ft( -\frac{(\mathrm{ln}x-μ)^{2}}{2σ^{2}} \right)
where μ is the mean on the log scale, and σ is the standard deviation on the log scale.
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 lognormal distribution over distances
# mean and standard deviation are just for example
kernMat = calcLognormalKernel(distMat = distMat, meanlog = 100, sdlog = 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.