Home‎ > ‎

Model Codes

Sunghoon Kim, Arizona State University (Last revised: January, 2018)


The R Code packages can be downloaded below. This code should not be used for any commercial purposes. Academic use is encouraged.

A Bayesian Multivariate Choice Mixture Model with Variable Selection
Reference: Kim, DeSarbo, and Fong (2018), "A Hierarchical Bayesian Approach for Examining Heterogeneity in Choice Decisions" Journal of Mathematical Psychology, 82 (February), 56-72.

A Bayesian Multinomial Probit Model
On this page, you can find the R code for a Bayesian Multinomial Probit Model for the analysis of panel choice data (Bayes_MNP.RAR file), Reference: Fong, Kim, Chen and DeSarbo (2016), "A Bayesian Multinomial Probit Model for the Analysis of Panel Choice Data" Psychometrika, 81(1), 161-183.

A Bayesian Finite Mixture Model with Unconstrained Variable Selection
This model simultaneously performs segmentation and regression analyses while identifying the optimial subset of variables independently for each derived segment. No constraints are imposed regarding variable selection or the estimation of regression coefficients for each segment. The unconstrained model works well overall in a large number of applications and is particularly recommended when the user does not have a-priori constraints to impose on the model. ReferenceKim, Fong, and DeSarbo (2012), "Model based segmentation featuring simultaneous segment level variable selection", Journal of Marketing Research , 49 (5), 725-736.

A Bayesian Finite Mixture Model with Common Factors Constraints on Variable Selection
This model also simultaneously performs segmentation and regression analyses, however the subect of optimial variables selected must be common variables across derived segments. As such, each variable is either selected for all segments or not at all; once selected the regression coefficients are free to vary across segments. ReferenceKim, Blanchard, DeSarbo, and Fong (2013), "Implementing Managerial Constraints in Model Based Segmentation: Extensions of Kim, Fong, and DeSarbo (2012) with an Application to Heterogeneous Perceptions of Service Quality", Journal of Marketing Research, 50 (5), 664-673.
 
A Bayesian Finite Mixture Model with Distinctive Factors Constraints on Variable Selection
This model also simultaneously performs segmentation and regression analyses, however it requires that the select variables be distinctive between the derived segments. As such, an independent variables can only be selected one derived segment at a time, if it all. ReferenceKim, Blanchard, DeSarbo, and Fong (2013), "Implementing Managerial Constraints in Model Based Segmentation: Extensions of Kim, Fong, and DeSarbo (2012) with an Application to Heterogeneous Perceptions of Service Quality", Journal of Marketing Research, 50 (5), 664-673.

A Bayesian Finite Mixture Model with Dimension Constrained Constraints on Variable Selection
This model simultaneously provides segmentation and regression analysis by selecting (at most) one significant variable per a priori dimension from each of the derived segment. ReferenceKim, Blanchard, DeSarbo, and Fong (2013), "Implementing Managerial Constraints in Model Based Segmentation: Extensions of Kim, Fong, and DeSarbo (2012) with an Application to Heterogeneous Perceptions of Service Quality", Journal of Marketing Research, 50 (5), 664-673.


<Disclaimer>

R codes for various models are available in this page (see references per each model). The packages include synthetic data for users to learn the use of the models. We developed this R code to be as user-friendly as possible. However, a minimum familiarity of R language and a knowledge of Bayesian statistics are assumed particularly with respect to the robustness of MCMC. There is no in-built protection against misuse, and this code is offered without any guarantee. 

Local Mode Solution Issue

For the suggested solutions, it is helpful to use a range of techniques as follows:

  • Assessing different aspects of the chains for the final solution (e.g., Log Marginal Likelihood (LML), Significances of Odds Ratio, Segmentation Mixture, Managerial Face Validity).
    • LML: Prefer to select the model solution of larger LML value.
    • Odds Ratio: Prefer the model solution of observing a subset of significant variables across segments (here, use odds ratio 20 for variable selection criteria).
    • Segmentation Mixture: Prefer solutions with seizable proportion (e.g., 10% or higher for each derived segment).
Note, MCMC samplers can become stuck in a local mode and some naively applied diagnostics may not detect that the MCMC chain has not explored the majority of the model/parameter space (see Gelman and Shirley 2011). We found the following two approaches helpful although they are NOT techniques to solve the Local Mode Problem:
  • Use independent chains with a range of different starting points.
  • MCMC error (Jones et al. 2006): Small MCMC error shows better quality or convergence of MCMC chain.
References about local mode problems
Gelman, Andrew and Kenneth Shirley (2011), "Inference from Simulations and Monitoring Convergence," Handbood of Markov Chain Monte Carlo, 163-174. 
Jones, Galin L., Murali Haran, Brian S. Caffo, and Ronald Neath (2006), "Fixed-Width Output Analysis for Markov Chain Monte Carlo," Journal of the American Statistical Association, 101, 1537--1547 


<Problem Report>
We are expecting the R codes to be easy to use and to be working well. Send questions or report bugs to Sunghoon Kim (E-mail: skim348@asu.edu). 
ċ
BayesMultivariateChoices with Variable Selection_ JMP (2018).zip
(1056k)
Sunghoon Kim,
Nov 20, 2017, 3:01 PM
ċ
Bayes_MNP.rar
(184k)
Sunghoon Kim,
Jan 11, 2015, 1:47 PM
ċ
Common.zip
(22k)
Sunghoon Kim,
Jan 19, 2015, 11:03 AM
ċ
Dimension.zip
(60k)
Sunghoon Kim,
Jan 19, 2015, 11:03 AM
ċ
Distinctive.zip
(30k)
Sunghoon Kim,
Jan 19, 2015, 11:03 AM
ċ
Unconstrained.zip
(29k)
Sunghoon Kim,
Jan 19, 2015, 11:03 AM
Comments