Learn R Programming

bayesm (version 3.0-2)

llnhlogit: Evaluate Log Likelihood for non-homothetic Logit Model

Description

llnhlogit evaluates log-likelihood for the Non-homothetic Logit model.

Usage

llnhlogit(theta, choice, lnprices, Xexpend)

Arguments

theta

parameter vector (see details section)

choice

n x 1 vector of choice (1, …, p)

lnprices

n x p array of log-prices

Xexpend

n x d array of vars predicting expenditure

Value

value of log-likelihood (sum of log prob of observed multinomial outcomes).

Warning

This routine is a utility routine that does not check the input arguments for proper dimensions and type.

Details

Non-homothetic logit model, \(Pr(i) = exp(tau v_i)/sum_j(exp(tau v_j))\)

\(v_i = alpha_i - e^{kappaStar_i}u^i - lnp_i\) tau is the scale parameter of extreme value error distribution. \(u^i\) solves \(u^i = psi_i(u^i)E/p_i\). \(ln(psi_i(U)) = alpha_i - e^{kappaStar_i}U\). \(lnE = gamma'Xexpend\).

Structure of theta vector alpha: (p x 1) vector of utility intercepts. kappaStar: (p x 1) vector of utility rotation parms expressed on natural log scale. gamma: (k x 1) -- expenditure variable coefs. tau: (1 x 1) -- logit scale parameter.

References

For further discussion, see Bayesian Statistics and Marketing by Rossi, Allenby and McCulloch,Chapter 4. http://www.perossi.org/home/bsm-1

See Also

simnhlogit

Examples

Run this code
##
N=1000
p=3
k=1
theta = c(rep(1,p),seq(from=-1,to=1,length=p),rep(2,k),.5)
lnprices = matrix(runif(N*p),ncol=p)
Xexpend = matrix(runif(N*k),ncol=k)
simdata = simnhlogit(theta,lnprices,Xexpend)
#
# let's evaluate likelihood at true theta
#
llstar = llnhlogit(theta,simdata$y,simdata$lnprices,simdata$Xexpend)

Run the code above in your browser using DataLab