calcLognormalKernel function

Calculate Lognormal Stochastic Matrix

Calculate Lognormal Stochastic Matrix

Given a distance matrix from calcVinEll, calculate a stochastic matrix where one step movement probabilities follow a lognormal density.

calcLognormalKernel(distMat, meanlog, sdlog)

Arguments

  • distMat: Distance matrix from calcVinEll
  • meanlog: Log mean of Lognormal distribution
  • sdlog: Log standard deviation of Lognormal distribution

Details

The distribution and density functions for the lognormal kernel are given below:

F(x)=12+12erf[lnxμ2σ] F(x)=\frac{1}{2} + \frac{1}{2} \mathrm{erf}[\frac{\mathrm{ln}x-\mu}{\sqrt{2}\sigma}] f(x)=1xσ2πexp((lnxμ)22σ2) f(x)=\frac{1}{x\sigma\sqrt{2\pi}}\mathrm{exp}\left( -\frac{(\mathrm{ln}x-\mu)^{2}}{2\sigma^{2}} \right)

where μ\mu is the mean on the log scale, and σ\sigma is the standard deviation on the log scale.

Examples

# 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)
  • Maintainer: Héctor Manuel Sánchez Castellanos
  • License: GPL-3
  • Last published: 2020-10-05