R/lpois.R

Defines functions lpois1 lpois lnorm

Documented in lnorm lpois lpois1

lnorm <- function(p, d) {
	-sum(d$nyes * pnorm((log(d$Q) - p[1])/p[2], 
		lower.tail = TRUE,  log.p = TRUE) + 
	d$nno * pnorm((log(d$Q) - p[1])/p[2], 
		lower.tail = FALSE, log.p = TRUE))
	}
	
lpois <- function(p, d) {
	-sum(d$nyes * ppois(p[2], d$Q/p[1], lower.tail = FALSE, 
		log.p = TRUE) + 
	d$nno * ppois(p[2], d$Q/p[1], lower.tail = TRUE, 
		log.p = TRUE))
	}
	
lpois1 <- function(q, p, d) lpois(c(q, p), d)

Try the MPDiR package in your browser

Any scripts or data that you put into this service are public.

MPDiR documentation built on May 31, 2017, 4:18 a.m.