logLogisticRegCndtlLike: A function that evaluates the log-likelihood for a logistic...

Description Usage Arguments Examples

View source: R/mcmc_funcs.R

Description

This function evaluates the log-likelihood of a logistic regression model in a numerically stable way. It uses the log-sum-exp trick.

Usage

1
logLogisticRegCndtlLike(y, linkedMeans)

Arguments

y

observed dependent variables, assumed to be coded as 0,1.

linkedMeans

a numeric vector. The model matrix times the beta vector.

Examples

1
2
3
xiB <- rnorm(length(y), mean = 100)
logLogisticRegCndtlLike(y, xiB)
sum(dbinom(y, 1, inv.logit(xiB), TRUE)) #-Inf

tbrown122387/mmcmc documentation built on Dec. 31, 2019, 12:34 p.m.