logitr Fast Estimation of Multinomial and Mixed Logit Models with Preference Space and Willingness to Pay Space Utility Parameterizations

2025-05-02 0 0 967.73KB 39 页 10玖币
侵权投诉
JSS Journal of Statistical Software
MMMMMM YYYY, Volume VV, Issue II. doi: 10.18637/jss.v000.i00
logitr: Fast Estimation of Multinomial and Mixed Logit
Models with Preference Space and Willingness to Pay
Space Utility Parameterizations
John Paul Helveston
George Washington University
Abstract
This paper introduces the logitr Rpackage for fast maximum likelihood estimation of multi-
nomial logit and mixed logit models with unobserved heterogeneity across individuals, which
is modeled by allowing parameters to vary randomly over individuals according to a chosen
distribution. The package is faster than other similar packages such as mlogit,gmnl,mixl,
and apollo, and it supports utility models specified with “preference space” or “willingness to
pay (WTP) space” parameterizations, allowing for the direct estimation of marginal WTP. The
typical procedure of computing WTP post-estimation using a preference space model can lead
to unreasonable distributions of WTP across the population in mixed logit models. The paper
provides a discussion of some of the implications of each utility parameterization for WTP esti-
mates. It also highlights some of the design features that enable logitr’s performant estimation
speed and includes a benchmarking exercise with similar packages. Finally, the paper highlights
additional features that are designed specifically for WTP space models, including a consistent
user interface for specifying models in either space and a parallelized multi-start optimization
loop, which is particularly useful for searching the solution space for different local minima when
estimating models with non-convex log-likelihood functions.
Keywords: logit, utility, preference, willingness to pay, discrete choice models, R, maximum likeli-
hood estimation.
1. Introduction
Choice modeling is a well-established statistical method for assessing consumer preferences across
a wide variety of fields. One of the most common approaches for modeling choice is the maximum
likelihood estimation of multinomial logit models (McFadden 1974), which is rooted in the theory
of random utility models (Louviere, Hensher, and Swait 2000;Train 2009). The central assumption
of these models is that individual consumers make choices that maximize an underlying random
arXiv:2210.10875v1 [stat.ME] 19 Oct 2022
2logitr: Preference and WTP Space Logit Models in R
utility model, which can be parameterized as a function of a product’s observed attributes and
a random variable representing the portion of utility unobservable to the modeler. These models
produce estimates of the marginal utility for changes in each attribute relative to one another.
In many applications, modelers are interested in estimating marginal “willingness to pay” (WTP)
for changes in product attributes. The typical procedure to obtain these estimates is to divide the
estimated parameters of a “preference space” utility model by the negative of the price parameter.
Despite this common practice, it can yield unreasonable distributions of WTP across the population
in heterogeneous random parameter (or “mixed logit”) models (Train and Weeks 2005;Sonnier,
Ainslie, and Otter 2007;Helveston, Feit, and Michalek 2018). For example, if the parameters for
the price attribute and another non-price attribute are both assumed to be normally distributed
across the population, then the resulting WTP estimate follows a Cauchy distribution, implying
that WTP has an infinite variance across the population.
An alternative approach is to re-parameterize the utility model into the “WTP space” prior to
estimation. Estimating a WTP space model allows the modeler to directly specify assumptions
of how WTP is distributed, which has been found to yield more reasonable estimates of WTP
(Train and Weeks 2005;Sonnier et al. 2007;Daly, Hess, and Train 2012). WTP space models have
also been found to be more consistent with respondent’s true underlying preferences (Crastesa,
Beaumaisb, Mahieud, Martinez-Camblore, and Scarpa 2014). Finally, since WTP estimates are
independent of error scaling, they can be conveniently compared across different models estimated
on different data.
Several statistical packages support the estimation of multinomial and mixed logit models with
WTP space utility parameterizations. One of the most common approaches involves an adaptation
of the generalized multinomial logit (GMNL) model (Fiebig, Keane, Louviere, and Wasi 2010) to fit
WTP space models via an implementation of the scaled multinomial logit (SMNL) model, though
this requires that the price parameter estimate and standard error be calculated post-estimation.
Estimation of WTP space models via GMNL has been implemented in R with the gmnl package
(Sarrias, Daziano et al. 2017) and in STATA with the gmnl package (Gu, Hole, and Knox 2013).
WTP space models can also be estimated using the apollo (Hess and Palma 2019) and mixl (Molloy,
Becker, Schmid, and Axhausen 2021) R packages as they allow the user to hand-specify any valid
utility model. Finally, Professor Arne Rise Hole developed two STATA packages that share a
common syntax for estimating mixed logit models in the preference space (mixlogit) and WTP
space (mixlogitwtp) (Hole 2007). Many other packages exist for estimating a wider variety of logit
models, but they are limited to preference space models. Of these, package mlogit (Croissant 2020)
is perhaps the most complete and widely used for estimating multinomial logit and mixed logit
models in R via maximum likelihood estimation.
The logitr package is designed specifically to support the estimation of multinomial logit and mixed
logit models models with either preference space or WTP space utility parameterizations. While
logitr is less general in scope compared to more flexible packages like mixl and apollo, it offers
other functionality that is particularly useful for estimating WTP space models and conveniently
switching between preference and WTP space models. For example, given their non-linear utility
specification, WTP space models often diverge during estimation and can be sensitive to starting
parameters. To address this, the package includes a parallelized multi-start optimization loop
to search for different local minima from different random starting points when minimizing the
negative log-likelihood. The user interface is also more streamlined and simplified for estimating
models in either space.
Package logitr is also computationally efficient and faster than other similar packages, including the
Journal of Statistical Software 3
mixl package which uses high performance C++ code to compile the log-likelihood function (Molloy
et al. 2021) (though mixl can be accelerated considerably via multi-core processing). The perfor-
mance gains are the result of a combination of design features, including how the choice probabilities
are specified, avoiding redundant computation by pre-computing constant intermediate variables,
and the use of analytic gradients that are optimized for efficiency.
The rest of the article is organized as follows: Section 2 provides an overview of the models sup-
ported by logitr, including multinomial and mixed logit models with preference space and WTP
space utility parameterizations. Section 3 discusses several important implications of preference
versus WTP space utility parameterizations on WTP estimates. Section 4 describes the software
architecture and performance. Section 5 then introduces the logitr package, including examples
of estimating multinomial and mixed logit models in both preference and WTP spaces as well as
additional functionality for estimating weighted models and making predictions. Section 6 explains
some limitations of WTP space models. Finally, Section 7 concludes the paper.
2. Models
2.1. The random utility model in two spaces
Random utility models assume that consumers choose the alternative jfrom a set of alternatives
that has the greatest utility uj. Utility is a random variable that is modeled as uj=vj+εj, where
vjis the “observed utility” (a function of the observed attributes such that vj=f(xj)) and εjis a
random variable representing the portion of utility unobservable to the modeler.
Adopting the same notation as in Helveston et al. (2018), consider the following utility model:
u
j=β∗>xj+αpj+ε
j, ε
jGumbel 0, σ2π2
6!(1)
where βis the vector of coefficients for non-price attributes xj,αis the coefficient for price pj,
and the error term, ε
j, is an IID random variable with a Gumbel extreme value distribution of
mean zero and variance σ2(π2/6).
This model is not identified since there exists an infinite set of combinations of values for β,α,
and σthat will produce the same choice probabilities. In order to specify an identifiable model,
Equation 1must be normalized. One approach is to normalize the scale of the error term by
dividing Equation 1by σ, producing the “preference space” utility specification (Train and Weeks
2005):
u
j
σ!=β
σ>
xj+α
σpj+ ε
j
σ!, ε
j
σ!Gumbel 0,π2
6!(2)
The typical preference space parameterization of the multinomial logit model can then be written
by rewriting Equation 2with uj= (u
j),β= (β),α= (α), and εj= (ε
j):
uj=β>xj+αpj+εjεjGumbel 0,π2
6!(3)
The vector βin Equation 3represents the marginal utility for changes in each non-price attribute
(relative to the standardized scale of the error term), and αrepresents the marginal utility obtained
4logitr: Preference and WTP Space Logit Models in R
from changes in price (relative to the standardized scale of the error term). The coefficients βand
αare only relative values rather than absolute and do not have units. Using this model, estimates
of the marginal WTP for changes in each non-price attribute could be computed by dividing ˆ
βby
ˆα, where the “hat” symbol indicates a parameter estimate.
An alternative approach to normalizing Equation 1is to divide by αinstead of σ, resulting in
the “WTP space” utility parameterization:
u
j
α!=β
α>
xj+α
αpj+ ε
j
α!, ε
j
α!Gumbel 0,σ2
(α)2
π2
6!(4)
Since the error term in Equation 4is scaled by λ2=σ2/(α)2, it can be rewritten by multiplying
both sides by λ= (α) and renaming uj= (λu
j/α),ω= (β/α), and εj= (λε
j/α):
uj=λω>xjpj+εjεjGumbel 0,π2
6!(5)
The vector ωin Equation 5represents the marginal WTP for changes in each non-price attribute,
and λrepresents the scale of the deterministic portion of utility relative to the standardized scale
of the random error term (also called the “scale parameter”). In contrast to the βcoefficients
from the preference space model in Equation 3, the ωcoefficients have absolute value with units
of currency.
The logitr package can fit logit models with either utility parameterization, and it contains functions
that facilitate the comparison of WTP estimates between models from the two model spaces.
2.2. Multinomial and mixed logit probabilities
By assuming that the error term in Equations 3and 5follows a Gumbel extreme value distribution,
the probability that a consumer will choose alternative jin choice situation nfollows a convenient,
closed form expression, cf. Train (2009):
Pnj =exp (vnj )
PJ
kexp (vnk),(6)
where vnj is the deterministic portion of the utility model and Jis the number of alternatives
in choice situation n. The multinomial logit model assumes homogeneous preferences across the
population and possess the independence of irrelevant alternatives (IIA) property, which means that
the ratio of any two probabilities is independent of the functions determining any other outcome
since
Pnj
Pnk
=exp (vnj )
exp (vnk),(7)
To relax this assumption and allow for heterogeneity of preferences across the population, the
multinomial logit model can be extended to the random coefficients “mixed” logit model (McFadden
and Train 2000) where probabilities are the integrals of standard logit probabilities over a density
of parameters across people:
Pnj =Z exp (vnj )
PJ
kexp (vnk)!f(θ)dθ,(8)
Journal of Statistical Software 5
where f(θ)is a density function and θcontains the parameters in the deterministic portion of the
utility model, which are βand αfor preference space models (Equation 3) and ωand λfor WTP
space models (Equation 5). The mixed logit probability can be interpreted as a weighted average
of the multinomial logit probability with weights given by the density f(θ).
Modelers often specify different mixing distributions for parameters in θdepending on assumptions
of how preferences might be distributed across the population. For example, modelers may assume
αfollows a log-normal or zero-censored normal distribution to force the price coefficient to remain
positive—an assumption based on the logic that most people prefer price decreases rather than
increases. Likewise, parameters in βare often assumed to follow a normal distribution if it is
unclear whether the utility parameters for attributes xjshould be positive or negative.
2.3. Maximum likelihood estimation
Parameters in the preference or WTP space utility models can be estimated by maximizing the
log-likelihood function. For the multinomial logit model, the log-likelihood is given by:
L=
N
X
n
J
X
j
ynj ln Pnj (9)
where ynj = 1 if alternative jis chosen in situation nand 0otherwise, Nis the number of choice
situations, Jis the number of alternatives in choice situation n, and the probabilities Pnj are given
by Equation 6.
For mixed logit models, the log-likelihood can be estimated using simulation to obtain estimates
of Pnj in Equation 8(Train 2009). Over a series of iterations, parameters are drawn from f(θ)
and used to compute the logit probability in Equation 6. The average probabilities over all of
the iterations, ˆ
Pnj , are then used in place of Pnj in Equation 9to compute the simulated log-
likelihood. Should the data contain a panel structure where multiple observations come from the
same individual, the product of the logit probabilities in Equation 6over all trials for each individual
must first computed and then averaged over the draws of each parameter drawn from f(θ)(Train
2009).
McFadden (1974) shows that the log-likelihood function is globally concave for linear-in-parameters
utility models with fixed parameters. This implies that optimization algorithms should always arrive
at a global solution when minimizing the negative log-likelihood for preference space models with
fixed parameters. In contrast, WTP space utility models (as well as mixed logit models with either
utility parameterization) have non-convex log-likelihood functions and thus are not guaranteed
to arrive at a global solution. For these models, different optimization strategies should be used
to minimize the negative log-likelihood, such as using a multi-start loop where the optimization
algorithm is run multiple times from different random starting points to search for multiple local
minima.
3. Implications of preference versus WTP space utility parameterizations
WTP estimates can be obtained from both preference and WTP space utility parameterizations. In
the preference space utility model given by Equation 3, WTP is estimated as ˆ
β/ˆα; in the WTP
space model given by Equation 5, WTP is simply ˆ
ω. The choice of which approach to use can
have important implications for estimates of WTP, and modelers should consider which outcomes
摘要:

JSSJournalofStatisticalSoftwareMMMMMMYYYY,VolumeVV,IssueII.doi:10.18637/jss.v000.i00logitr:FastEstimationofMultinomialandMixedLogitModelswithPreferenceSpaceandWillingnesstoPaySpaceUtilityParameterizationsJohnPaulHelvestonGeorgeWashingtonUniversityAbstractThispaperintroducesthelogitrRpackageforfastma...

展开>> 收起<<
logitr Fast Estimation of Multinomial and Mixed Logit Models with Preference Space and Willingness to Pay Space Utility Parameterizations.pdf

共39页,预览5页

还剩页未读, 继续阅读

声明:本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。玖贝云文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知玖贝云文库,我们立即给予删除!
分类:图书资源 价格:10玖币 属性:39 页 大小:967.73KB 格式:PDF 时间:2025-05-02

开通VIP享超值会员特权

  • 多端同步记录
  • 高速下载文档
  • 免费文档工具
  • 分享文档赚钱
  • 每日登录抽奖
  • 优质衍生服务
/ 39
客服
关注