rmnlIndepMetrop {bayesm} | R Documentation

## MCMC Algorithm for Multinomial Logit Model

### Description

`rmnIndepMetrop` implements Independence Metropolis for the MNL.

### Usage

    rmnlIndepMetrop(Data, Prior, Mcmc)

### Arguments

`Data` | list(p,y,X)
`Prior` | list(A,betabar) optional
`Mcmc` | list(R,keep,nu)

### Details

Model: y ~ MNL(X,beta). Pr(y=j) = exp(x_j'beta)/sum_k{e^{x_k'beta}}.

Prior: beta ~ N(betabar,A^{-1})

list arguments contain:

`p`
  number of alternatives
`y`
  nobs vector of multinomial outcomes (1,..., p)
`X`
  nobs*p x nvar matrix
`A`
  nvar x nvar pds prior prec matrix (def: .01I)
`betabar`
  nvar x 1 prior mean (def: 0)
`R`
  number of MCMC draws
`keep`
  MCMC thinning parm: keep every keepth draw (def: 1)
`nu`
  degrees of freedom parameter for independence t density (def: 6)

### Value

a list containing:

`betadraw` | R/keep x nvar array of beta draws
`loglike` | R/keep vector of loglike values for each draw
`acceptr` | acceptance rate of Metropolis draws

### Author(s)

Peter Rossi, Graduate School of Business, University of Chicago, Peter.Rossi@ChicagoGsb.edu.

### References

For further discussion, see Bayesian Statistics and Marketing by Rossi, Allenby and McCulloch, Chapter 5.
http://gsbwww.uchicago.edu/fac/peter.rossi/research/bsm.html

### See Also

`rhierMnlRwMixture`

### Examples

    ##

    if(nchar(Sys.getenv("LONG_TEST")) != 0) {R=2000} else {R=10}

    set.seed(66)
    n=200; p=3; beta=c(1,-1,1.5,.5)
    simout=simmnl(p,n,beta)
    A=diag(c(rep(.01,length(beta)))); betabar=rep(0,length(beta))

    Data=list(y=simout$y,X=simout$X,p=p); Mcmc=list(R=R,keep=1) ; Prior=list(A=A,betabar=betabar)
    out=rmnlIndepMetrop(Data=Data,Prior=Prior,Mcmc=Mcmc)
    cat(" Betadraws ",fill=TRUE)
    mat=apply(out$betadraw,2,quantile,probs=c(.01,.05,.5,.95,.99))
    mat=rbind(beta,mat); rownames(mat)[1]="beta"; print(mat)

[Package bayesm version 2.0-8 Index]