`mnpProb`

computes MNP probabilities for a given X matrix corresponding to one
observation. This function can be used with output from `rmnpGibbs`

to simulate
the posterior distribution of market shares or fitted probabilties.

1 |

`beta` |
MNP coefficients |

`Sigma` |
Covariance matrix of latents |

`X` |
X array for one observation – use |

`r` |
number of draws used in GHK (def: 100) |

see `rmnpGibbs`

for definition of the model and the interpretation of
the beta, Sigma parameters. Uses the GHK method to compute choice probabilities.
To simulate a distribution of probabilities, loop over the beta, Sigma draws from
`rmnpGibbs`

output.

p x 1 vector of choice probabilites

Peter Rossi, Anderson School, UCLA, perossichi@gmail.com.

For further discussion, see *Bayesian Statistics and Marketing*
by Rossi,Allenby and McCulloch, Chapters 2 and 4.

http://www.perossi.org/home/bsm-1

`rmnpGibbs`

, `createX`

1 2 3 4 5 6 7 8 | ```
##
## example of computing MNP probabilites
## here I'm thinking of Xa as having the prices of each of the 3 alternatives
Xa=matrix(c(1,.5,1.5),nrow=1)
X=createX(p=3,na=1,nd=NULL,Xa=Xa,Xd=NULL,DIFF=TRUE)
beta=c(1,-1,-2) ## beta contains two intercepts and the price coefficient
Sigma=matrix(c(1,.5,.5,1),ncol=2)
mnpProb(beta,Sigma,X)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.