Learn R Programming

scanstatistics (version 0.1.0)

zip_em_estimates: Estimates the ZIP relative risk and excess zero indicators for a window.

Description

For a single spatial or space-time window, this function uses the EM algorithm to estimate the relative risk and the excess zero indicators for counts assumed to be generated from a zero-inflated Poisson distribution.

Usage

zip_em_estimates(p, mu, y, d_init = 0.5, tol = 0.01)

Arguments

p

A numeric vector of the given/estimated excess zero probabilities corresponding to each count.

mu

A numeric vector of the given/estimated Poisson expected value parameters corresponding to each count. Of same length as p.

y

An integer vector of the observed counts, of same length as p.

d_init

A scalar between 0 and 1. The initial guess for the estimate of the excess zero indicator.

tol

A scalar between 0 and 1. It is the absolute tolerance criterion for the estimate of the excess zero indicator; convergence is reached when two successive elements in the sequence of estimates have an absolute difference less than tol.

Value

A list with two elements:

q

Scalar estimate of the relative risk.

dstar

Estimates of the excess zero indicator variables.