# calcHurdleExpKernel: Calculate Zero-inflated Exponential Stochastic Matrix In MGDrivE: Mosquito Gene Drive Explorer

## Description

Given a distance matrix from `calcVinEll`, calculate a stochastic matrix where one step movement probabilities follow an zero-inflated exponential density with a point mass at zero. The point mass at zero represents the first stage of a two-stage process, where mosquitoes decide to stay at their current node or leave anywhere. This parameter can be calculated from lifetime probabilities to stay at the current node with the helper function `calcZeroInflation`.

## Usage

 `1` ```calcHurdleExpKernel(distMat, rate, p0) ```

## Arguments

 `distMat` Distance matrix from `calcVinEll` `rate` Rate parameter of `Exponential` distribution `p0` Point mass at zero

## Details

If a mosquito leaves its current node, with probability 1-p_{0}, it then chooses a destination node according to a standard exponential density with rate parameter rate.

The distribution and density functions for the zero inflated exponential kernel are given below:

F(x)=p_{0}θ(x) + (1-p_{0})(1-e^{-λ x})

f(x)=p_{0}δ(x)+(1-p_{0})λ e^{-λ x}

where λ is the rate parameter of the exponential distribution, θ(x) is the Heaviside step function and δ(x) is the Dirac delta function.

## Examples

 ``` 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 hurdle exponential distribution over distances # rate and point mass are just for example kernMat = calcHurdleExpKernel(distMat = distMat, rate = 1/1e6, p0 = 0.1) ```

MGDrivE documentation built on Oct. 23, 2020, 7:28 p.m.