Learn R Programming

bayess (version 1.4)

loglinnoinflpost: Log of the posterior density for the log-linear model under a noninformative prior

Description

This function computes the logarithm of the posterior density associated with a log-linear model and the noninformative prior used in Chapter 4.

Usage

loglinnoinflpost(beta, y, X)

Arguments

beta
parameter of the log-linear model
y
binary response variable
X
covariate matrix

Value

  • returns the logarithm of the logit posterior density for the data y, covariate matrix X and parameter vector beta

Details

This function does not test for coherence between the lengths of y, X and beta, hence may return an error message in case of incoherence.

Examples

Run this code
X=matrix(rnorm(20*3),ncol=3)
beta=c(3,-2,1)
y=rpois(20,exp(X%*%beta))
loglinnoinflpost(beta, y, X)

Run the code above in your browser using DataLab