Modélisation des choix pour le marketing avec R
Elea McDonnell Feit
Assistant Professor of Marketing, Drexel University
v1 <- alpha * 4 + beta * 100
v2 <- alpha * 5 + beta * 150
v3 <- alpha * 2 + beta * 175
u1 <- v1 + error1
u2 <- v2 + error2
u3 <- v3 + error3
choice <- which.max(c(u1, u2, u3))
p1 <- exp(v1) / ( exp(v1) + exp(v2) + exp(v3) )
p2 <- exp(v2) / ( exp(v1) + exp(v2) + exp(v3) )
p3 <- exp(v3) / ( exp(v1) + exp(v2) + exp(v3) )
m1 <- mlogit(choice ~ 0 + seat + price, data = sportscar, print.level = 3)
Valeur initiale de la fonction : 2197.22457733622
itération 1, pas = 1, lnL = 1918.11271719, khi2 = 534.02624615
seat price
param 0.100 -0.151
gradient -24.028 296.443
----------------------------------------
itération 2, pas = 1, lnL = 1915.29601553, khi2 = 5.51592264
seat price
param 0.114 -0.168
gradient -0.846 9.422
----------------------------------------
itération 3, pas = 1, lnL = 1915.29299604, khi2 = 0.00603424
seat price
param 0.114 -0.169
gradient -0.001 0.011
summary(m1)
Appel :
mlogit(formula = choice ~ 0 + seat + price, data = sportscar,
print.level = 3, method = "nr")
Fréquences des options :
1 2 3
0.328 0.327 0.345
méthode nr
4 itérations, 0h:0m:0s
g'(-H)^-1g = 0.00603
valeurs successives de la fonction dans les seuils de tolérance
Coefficients :
Estimation Écart-type z Pr(>|z|)
seat 0.1143487 0.0234195 4.8826 1.047e-06 ***
price -0.1687046 0.0079224 -21.2947 < 2.2e-16 ***
Codes de signification : 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Log-vraisemblance : -1915.3
sportscar <- mlogit.data(sportscar.df, shape = "long",
choice = "choice",
varying = 5:8, alt.var = "alt")
Modélisation des choix pour le marketing avec R