R/loglinll.R

Defines functions loglinll

Documented in loglinll

loglinll=function(beta,y,X)
{

# Log-likelihood of the log-linear model (log-posterior of the log-linear
# model under flat prior)

if (is.matrix(beta)==FALSE) beta=as.matrix(t(beta))
n=dim(beta)[1]
pll=rep(0,n)
for (i in 1:n)
{
lF=exp(X%*%beta[i,])
pll[i]=sum(dpois(y,lF,log=T))
}
pll
}

Try the bayess package in your browser

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

bayess documentation built on Aug. 11, 2022, 5:07 p.m.