diff --git a/404.html b/404.html index 45ea8e9..35db6f7 100644 --- a/404.html +++ b/404.html @@ -43,7 +43,7 @@
diff --git a/LICENSE-text.html b/LICENSE-text.html index 5273d16..131176c 100644 --- a/LICENSE-text.html +++ b/LICENSE-text.html @@ -17,7 +17,7 @@ diff --git a/LICENSE.html b/LICENSE.html index 553bad4..6d12683 100644 --- a/LICENSE.html +++ b/LICENSE.html @@ -17,7 +17,7 @@ diff --git a/articles/basic_usage.html b/articles/basic_usage.html index 923ba10..b232077 100644 --- a/articles/basic_usage.html +++ b/articles/basic_usage.html @@ -44,7 +44,7 @@ @@ -319,9 +319,9 @@
wtp(mnl_pref, scalePar = "price")
#> Estimate Std. Error z-value Pr(>|z|)
-#> scalePar 0.366555 0.024498 14.9624 < 2.2e-16 ***
-#> feat 1.340699 0.360051 3.7236 0.0001964 ***
-#> brandhiland -10.136219 0.586111 -17.2940 < 2.2e-16 ***
-#> brandweight -1.749094 0.181445 -9.6398 < 2.2e-16 ***
-#> brandyoplait 2.003848 0.143388 13.9750 < 2.2e-16 ***
+#> scalePar 0.366555 0.024323 15.0700 < 2.2e-16 ***
+#> feat 1.340699 0.360087 3.7233 0.0001967 ***
+#> brandhiland -10.136219 0.583007 -17.3861 < 2.2e-16 ***
+#> brandweight -1.749094 0.180936 -9.6669 < 2.2e-16 ***
+#> brandyoplait 2.003848 0.143863 13.9288 < 2.2e-16 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The wtp()
function divides the non-price parameters by
@@ -464,14 +464,14 @@
The resulting probs
data frame contains the expected
probabilities for each alternative. The lower and upper predictions
reflect a 95% confidence interval (controlled by the ci
@@ -490,14 +490,14 @@
You can also use the predict()
method to predict
outcomes by setting type = "outcome"
(the default value is
"prob"
for predicting probabilities). If no new data are
@@ -515,8 +515,8 @@
chosen <- subset(outcomes, choice == 1)
chosen$correct <- chosen$choice == chosen$predicted_outcome
sum(chosen$correct) / nrow(chosen)
-#> [1] 0.3706468
+#> [1] 0.3747927
See the “Predicting Probabilities and Choices from Estimated Models” vignette for more details about making predictions.
diff --git a/articles/benchmark.html b/articles/benchmark.html index d9790e6..471b888 100644 --- a/articles/benchmark.html +++ b/articles/benchmark.html @@ -44,7 +44,7 @@ diff --git a/articles/convergence.html b/articles/convergence.html index c380668..3966a0a 100644 --- a/articles/convergence.html +++ b/articles/convergence.html @@ -44,7 +44,7 @@ @@ -372,10 +372,13 @@The same model is now estimated using all five packages.
+The same model is now estimated using all five packages. We will see +that only {logitr} is able to converge to a solution, while all other +package either fail to converge or converge to only a local minimum.
{logitr} converges, even without running a multi-start:
model_logitr <- logitr(
data = yogurt,
@@ -387,10 +390,9 @@ {logitr} randPars = c(feat = "n", brand = "n"),
startVals = start_wtp,
numDraws = numDraws_wtp
-)
{logitr} converges, even without running a multi-start:
-
-summary(model_logitr)
#> =================================================
#>
#> Model estimated on: Sat Oct 01 16:46:57 2022
@@ -447,9 +449,9 @@ {logitr}#> brandhiland -Inf -17.4039453 -13.538553 -13.542027 -9.674388 Inf
#> brandweight -Inf -12.2189602 -4.519436 -4.527690 3.182253 Inf
#> brandyoplait -Inf 0.6670773 6.648678 6.641070 12.632059 Inf
-Including a multi-start helps build confidence in the solution +
Including a 10-run multi-start helps build confidence in the solution reached:
-+-model_logitr <- logitr( data = yogurt, outcome = 'choice', @@ -461,32 +463,47 @@
{logitr} startVals = start_wtp, numDraws = numDraws_wtp, numMultiStarts = 10 -)
+) + +summary(model_logitr)-summary(model_logitr)
#> =================================================
#>
-#> Model estimated on: Sat Oct 01 16:46:57 2022
+#> Model estimated on: Sun Sep 24 14:02:07 2023
#>
-#> Using logitr version: 0.8.0
+#> Using logitr version: 1.1.0
#>
#> Call:
#> logitr(data = yogurt, outcome = "choice", obsID = "obsID", pars = c("feat",
#> "brand"), scalePar = "price", randPars = c(feat = "n", brand = "n"),
-#> panelID = "id", startVals = start_wtp, numDraws = numDraws_wtp,
-#> numCores = numCores)
+#> panelID = "id", startVals = start_wtp, numMultiStarts = 10,
+#> numDraws = numDraws_wtp)
#>
#> Frequencies of alternatives:
#> 1 2 3 4
#> 0.415721 0.029984 0.170989 0.383306
#>
+#> Summary Of Multistart Runs:
+#> Log Likelihood Iterations Exit Status
+#> 1 -732.2132 86 3
+#> 2 -728.0567 50 3
+#> 3 -734.7358 67 3
+#> 4 -725.4327 68 3
+#> 5 -731.0111 71 3
+#> 6 -731.3684 58 3
+#> 7 -749.7861 72 3
+#> 8 -718.0862 95 3
+#> 9 -745.6384 50 3
+#> 10 -722.1385 68 3
+#>
+#> Use statusCodes() to view the meaning of each status code
+#>
#> Exit Status: 3, Optimization stopped because ftol_rel or ftol_abs was reached.
#>
#> Model Type: Mixed Logit
#> Model Space: Willingness-to-Pay
-#> Model Run: 1 of 1
-#> Iterations: 85
-#> Elapsed Time: 0h:0m:4s
+#> Model Run: 8 of 10
+#> Iterations: 95
+#> Elapsed Time: 0h:0m:2s
#> Algorithm: NLOPT_LD_LBFGS
#> Weights Used?: FALSE
#> Panel ID: id
@@ -494,82 +511,83 @@ {logitr}#>
#> Model Coefficients:
#> Estimate Std. Error z-value Pr(>|z|)
-#> scalePar 0.388098 0.050706 7.6538 1.954e-14 ***
-#> feat 1.738832 0.725107 2.3980 0.01648 *
-#> brandhiland -13.536714 1.810701 -7.4760 7.661e-14 ***
-#> brandweight -4.510068 1.015856 -4.4397 9.010e-06 ***
-#> brandyoplait 6.663869 0.929658 7.1681 7.605e-13 ***
-#> sd_feat 0.491225 1.072013 0.4582 0.64679
-#> sd_brandhiland 5.730571 1.125803 5.0902 3.577e-07 ***
-#> sd_brandweight 11.420500 1.727799 6.6099 3.847e-11 ***
-#> sd_brandyoplait 8.872470 1.366376 6.4934 8.390e-11 ***
+#> scalePar 0.378986 0.048908 7.7490 9.326e-15 ***
+#> feat 1.746832 0.725116 2.4090 0.01599 *
+#> brandhiland -13.708716 1.788570 -7.6646 1.799e-14 ***
+#> brandweight -9.382873 1.543072 -6.0806 1.197e-09 ***
+#> brandyoplait 4.251573 0.628295 6.7668 1.316e-11 ***
+#> sd_feat -0.930817 0.828995 -1.1228 0.26151
+#> sd_brandhiland -4.841849 0.901030 -5.3737 7.715e-08 ***
+#> sd_brandweight 10.849573 1.583590 6.8513 7.321e-12 ***
+#> sd_brandyoplait 7.813052 1.129764 6.9157 4.657e-12 ***
#> ---
-#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
+#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
-#> Log-Likelihood: -732.2132421
+#> Log-Likelihood: -718.0862026
#> Null Log-Likelihood: -1710.6872416
-#> AIC: 1482.4264842
-#> BIC: 1528.4886000
-#> McFadden R2: 0.5719771
-#> Adj McFadden R2: 0.5667161
+#> AIC: 1454.1724052
+#> BIC: 1500.2346000
+#> McFadden R2: 0.5802352
+#> Adj McFadden R2: 0.5749742
#> Number of Observations: 1234.0000000
#>
#> Summary of 10k Draws for Random Coefficients:
-#> Min. 1st Qu. Median Mean 3rd Qu. Max.
-#> feat -Inf 1.4071720 1.738457 1.738145 2.069629 Inf
-#> brandhiland -Inf -17.4039453 -13.538553 -13.542027 -9.674388 Inf
-#> brandweight -Inf -12.2189602 -4.519436 -4.527690 3.182253 Inf
-#> brandyoplait -Inf 0.6670773 6.648678 6.641070 12.632059 Inf
+#> Min. 1st Qu. Median Mean 3rd Qu. Max.
+#> feat -Inf 1.120009 1.747543 1.748135 2.375291 Inf
+#> brandhiland -Inf -16.972056 -13.707162 -13.704227 -10.441231 Inf
+#> brandweight -Inf -16.706387 -9.391773 -9.399614 -2.075102 Inf
+#> brandyoplait -Inf -1.029171 4.238197 4.231497 9.507132 Inf
First attempt using same starting points as {logitr}
-+model_mixl <- estimate( mixl_spec_wtp, start_wtp, data_mixl, availabilities, nDraws = numDraws_wtp )
{mixl} converges to a local minimum:
-+ --#> [1] -732.2132 -1544.8531
++#> [1] -718.0862 -1544.8531
+#> scalePar 0.3789865 -2270.55731 +#> feat 1.7468317 42.24281 +#> brandhiland -13.7087157 24.36731 +#> brandweight -9.3828735 110.99687 +#> brandyoplait 4.2515734 -492.36959 +#> sd_feat -0.9308170 10.81470 +#> sd_brandhiland -4.8418491 10.23414 +#> sd_brandweight 10.8495725 334.92761 +#> sd_brandyoplait 7.8130522 915.14924#> [,1] [,2] -#> scalePar 0.3880976 -2270.55731 -#> feat 1.7388324 42.24281 -#> brandhiland -13.5367140 24.36731 -#> brandweight -4.5100684 110.99687 -#> brandyoplait 6.6638687 -492.36959 -#> sd_feat 0.4912255 10.81470 -#> sd_brandhiland 5.7305708 10.23414 -#> sd_brandweight 11.4204997 334.92761 -#> sd_brandyoplait 8.8724698 915.14924
Second attempt using {logitr} solution as starting points
-+#> 0.3665863 1.3405842 -10.1357665 -1.7490311 2.0037959+-model_mixl <- estimate( mixl_spec_wtp, coef(model_logitr), data_mixl, availabilities, nDraws = numDraws_wtp )
Again, {mixl} converges to a local minimum:
-@@ -316,9 +316,9 @@+Again, {mixl} converges to a local minimum (though it’s closer than +the previous solution):
+ --#> [1] -732.2132 -1544.8531
++ -#> [1] -718.0862 -761.5228
+#> [,1] [,2] -#> scalePar 0.3880976 -2270.55731 -#> feat 1.7388324 42.24281 -#> brandhiland -13.5367140 24.36731 -#> brandweight -4.5100684 110.99687 -#> brandyoplait 6.6638687 -492.36959 -#> sd_feat 0.4912255 10.81470 -#> sd_brandhiland 5.7305708 10.23414 -#> sd_brandweight 11.4204997 334.92761 -#> sd_brandyoplait 8.8724698 915.14924
#> [,1] [,2] +#> scalePar 0.3789865 0.01959803 +#> feat 1.7468317 66.46247619 +#> brandhiland -13.7087157 -172.32720627 +#> brandweight -9.3828735 -114.92946558 +#> brandyoplait 4.2515734 6.24519288 +#> sd_feat -0.9308170 -36.14686337 +#> sd_brandhiland -4.8418491 -227.05348964 +#> sd_brandweight 10.8495725 198.52035799 +#> sd_brandyoplait 7.8130522 173.44727278
{gmnl} @@ -577,7 +595,7 @@
{gmnl}
First attempt using same starting points as {logitr}. Note that additional starting parameters must be added as the {gmnl} approach to estimating WTP is a slightly different model.
-@@ -221,9 +221,9 @@+model_gmnl <- gmnl( data = data_gmnl, formula = choice ~ price + feat + brand | 0 | 0 | 0 | 1, @@ -593,24 +611,24 @@
{gmnl} R = numDraws_wtp )
{gmnl} converges to a local minimum:
-@@ -167,9 +167,9 @@+ --#> [1] -732.2132 -1710.6872
diff --git a/articles/interactions.html b/articles/interactions.html index b5e4844..74f131d 100644 --- a/articles/interactions.html +++ b/articles/interactions.html @@ -44,7 +44,7 @@++#> [1] -718.0862 -1710.6872
+#> feat 0.3789865 8.1540692 +#> brandhiland 1.7468317 4.4266391 +#> brandweight -13.7087157 20.9581382 +#> brandyoplait -9.3828735 -93.0969112 +#> het.(Intercept) 4.2515734 -440.5183170 +#> sd.feat -0.9308170 2.4208585 +#> sd.brandhiland -4.8418491 0.1085233 +#> sd.brandweight 10.8495725 53.2376327 +#> sd.brandyoplait 7.8130522 95.0008933 +#> tau 0.3789865 653.9956379#> [,1] [,2] -#> feat 0.3880976 8.1540692 -#> brandhiland 1.7388324 4.4266391 -#> brandweight -13.5367140 20.9581382 -#> brandyoplait -4.5100684 -93.0969112 -#> het.(Intercept) 6.6638687 -440.5183170 -#> sd.feat 0.4912255 2.4208585 -#> sd.brandhiland 5.7305708 0.1085233 -#> sd.brandweight 11.4204997 53.2376327 -#> sd.brandyoplait 8.8724698 95.0008933 -#> tau 0.3880976 653.9956379
Second attempt using {logitr} solution as starting points:
-+-model_gmnl <- gmnl( data = data_gmnl, formula = choice ~ price + feat + brand | 0 | 0 | 0 | 1, @@ -625,16 +643,29 @@
{gmnl} start = c(coef(model_logitr), 0.1, 0.1, 0), R = numDraws_wtp )
-#> Error in optim(par = c(feat = 1.74, brandhiland = -13.54, brandweight = -4.51, : -#> initial value in 'vmmin' is not finite
In this case, {gmnl} fails due to an error with the starting values -provided.
+Again, {gmnl} converges to a local minimum:
+ ++ +#> [1] -718.0862 -944.3339
#> [,1] [,2] +#> feat 0.3789865 2.321317 +#> brandhiland 1.7468317 -18.785933 +#> brandweight -13.7087157 -5.977394 +#> brandyoplait -9.3828735 1.761744 +#> het.(Intercept) 4.2515734 6.168432 +#> sd.feat -0.9308170 2.830422 +#> sd.brandhiland -4.8418491 6.358857 +#> sd.brandweight 10.8495725 10.600978 +#> sd.brandyoplait 7.8130522 5.455189 +#> tau 0.3789865 8.230516
@@ -251,9 +251,9 @@{apollo}
First attempt using same starting points as {logitr}:
-diff --git a/articles/data_formatting.html b/articles/data_formatting.html index 409b52a..b610d04 100644 --- a/articles/data_formatting.html +++ b/articles/data_formatting.html @@ -44,7 +44,7 @@+-model_apollo <- apollo_estimate( apollo_beta = start_wtp, apollo_fixed = NULL, @@ -642,24 +673,26 @@
{apollo} apollo_inputs = apollo_inputs_wtp, estimate_settings = list(printLevel = 0) )
{apollo} converges to a local minimum:
- --#> [1] -732.2132 -776.5525
+{apollo} fails to converge and just returns the starting +coefficients:
+ ++ -#> model +#> -718.0862 -2928.4048
+#> [,1] [,2] -#> scalePar 0.3880976 0.02264706 -#> feat 1.7388324 52.92881692 -#> brandhiland -13.5367140 -129.27886303 -#> brandweight -4.5100684 -104.76878544 -#> brandyoplait 6.6638687 23.77062341 -#> sd_feat 0.4912255 11.06432598 -#> sd_brandhiland 5.7305708 -86.57222932 -#> sd_brandweight 11.4204997 164.38217567 -#> sd_brandyoplait 8.8724698 156.45076147
#> [,1] +#> scalePar 0.3789865 +#> feat 1.7468317 +#> brandhiland -13.7087157 +#> brandweight -9.3828735 +#> brandyoplait 4.2515734 +#> sd_feat -0.9308170 +#> sd_brandhiland -4.8418491 +#> sd_brandweight 10.8495725 +#> sd_brandyoplait 7.8130522
Second attempt using {logitr} solution as starting points:
-+-model_apollo <- apollo_estimate( apollo_beta = coef(model_logitr), apollo_fixed = NULL, @@ -667,22 +700,23 @@
{apollo} apollo_inputs = apollo_inputs_wtp, estimate_settings = list(printLevel = 0) )
Again, {apollo} converges to a local minimum:
- -- +#> [1] -732.2132 -772.6268
This time {apollo} converges to a local minimum:
+ ++#> model +#> -718.0862 -769.7493
+#> scalePar 0.3789865 2.376434e-04 +#> feat 1.7468317 5.213661e+03 +#> brandhiland -13.7087157 -1.622643e+04 +#> brandweight -9.3828735 -1.529634e+04 +#> brandyoplait 4.2515734 4.573893e+03 +#> sd_feat -0.9308170 6.131294e+02 +#> sd_brandhiland -4.8418491 -9.461200e+03 +#> sd_brandweight 10.8495725 1.260092e+04 +#> sd_brandyoplait 7.8130522 1.347027e+04#> [,1] [,2] -#> scalePar 0.3880976 2.180707e-03 -#> feat 1.7388324 7.365495e+02 -#> brandhiland -13.5367140 -2.378832e+03 -#> brandweight -4.5100684 -1.382908e+03 -#> brandyoplait 6.6638687 1.571897e+02 -#> sd_feat 0.4912255 -3.484523e+02 -#> sd_brandhiland 5.7305708 9.805109e+02 -#> sd_brandweight 11.4204997 1.899130e+03 -#> sd_brandyoplait 8.8724698 1.211976e+03
Creating dummy coded variablessummary(mnl_pref_dummies) #> ================================================= #> -#> Model estimated on: Tue Jun 27 21:11:30 2023 +#> Model estimated on: Sun Sep 24 18:54:30 2023 #> -#> Using logitr version: 1.1.0 +#> Using logitr version: 1.1.1 #> #> Call: #> logitr(data = yogurt2, outcome = "choice", obsID = "obsID", pars = c("price", @@ -269,7 +269,7 @@
Creating dummy coded variables#> Model Space: Preference #> Model Run: 1 of 1 #> Iterations: 18 -#> Elapsed Time: 0h:0m:0.17s +#> Elapsed Time: 0h:0m:0.04s #> Algorithm: NLOPT_LD_LBFGS #> Weights Used?: FALSE #> Robust? FALSE diff --git a/articles/index.html b/articles/index.html index de443af..c6188cd 100644 --- a/articles/index.html +++ b/articles/index.html @@ -17,7 +17,7 @@
Interactions with continuous var
summary(model_price_feat) #> ================================================= #> -#> Model estimated on: Tue Jun 27 21:11:36 2023 +#> Model estimated on: Sun Sep 24 18:54:34 2023 #> -#> Using logitr version: 1.1.0 +#> Using logitr version: 1.1.1 #> #> Call: #> logitr(data = yogurt, outcome = "choice", obsID = "obsID", pars = c("price", @@ -234,9 +234,9 @@
Interactions with discrete variabl
summary(model_price_brand) #> ================================================= #> -#> Model estimated on: Tue Jun 27 21:11:37 2023 +#> Model estimated on: Sun Sep 24 18:54:35 2023 #> -#> Using logitr version: 1.1.0 +#> Using logitr version: 1.1.1 #> #> Call: #> logitr(data = yogurt, outcome = "choice", obsID = "obsID", pars = c("price", @@ -252,7 +252,7 @@
Interactions with discrete variabl #> Model Space: Preference #> Model Run: 1 of 1 #> Iterations: 37 -#> Elapsed Time: 0h:0m:0.08s +#> Elapsed Time: 0h:0m:0.06s #> Algorithm: NLOPT_LD_LBFGS #> Weights Used?: FALSE #> Robust? FALSE @@ -326,9 +326,9 @@
Interactions with indiv
summary(model_price_group) #> ================================================= #> -#> Model estimated on: Tue Jun 27 21:11:38 2023 +#> Model estimated on: Sun Sep 24 18:54:36 2023 #> -#> Using logitr version: 1.1.0 +#> Using logitr version: 1.1.1 #> #> Call: #> logitr(data = yogurt, outcome = "choice", obsID = "obsID", pars = c("price", @@ -344,7 +344,7 @@
Interactions with indiv #> Model Space: Preference #> Model Run: 1 of 1 #> Iterations: 26 -#> Elapsed Time: 0h:0m:0.06s +#> Elapsed Time: 0h:0m:0.04s #> Algorithm: NLOPT_LD_LBFGS #> Weights Used?: FALSE #> Robust? FALSE @@ -393,9 +393,9 @@
Interactions in mixed logit modelssummary(model_price_feat_mxl) #> ================================================= #> -#> Model estimated on: Tue Jun 27 21:11:39 2023 +#> Model estimated on: Sun Sep 24 18:54:36 2023 #> -#> Using logitr version: 1.1.0 +#> Using logitr version: 1.1.1 #> #> Call: #> logitr(data = yogurt, outcome = "choice", obsID = "obsID", pars = c("price", diff --git a/articles/mnl_models.html b/articles/mnl_models.html index ce3cab3..44054cb 100644 --- a/articles/mnl_models.html +++ b/articles/mnl_models.html @@ -44,7 +44,7 @@
Preference space modelsummary(mnl_pref) #> ================================================= #> -#> Model estimated on: Tue Jun 27 21:11:48 2023 +#> Model estimated on: Sun Sep 24 18:54:44 2023 #> -#> Using logitr version: 1.1.0 +#> Using logitr version: 1.1.1 #> #> Call: #> logitr(data = yogurt, outcome = "choice", obsID = "obsID", pars = c("price", @@ -239,7 +239,7 @@
Preference space model#> Model Space: Preference #> Model Run: 1 of 1 #> Iterations: 21 -#> Elapsed Time: 0h:0m:0.09s +#> Elapsed Time: 0h:0m:0.04s #> Algorithm: NLOPT_LD_LBFGS #> Weights Used?: FALSE #> Robust? FALSE @@ -271,11 +271,11 @@
Preference space modelwtp_mnl_pref <- wtp(mnl_pref, scalePar = "price") wtp_mnl_pref #> Estimate Std. Error z-value Pr(>|z|) -#> scalePar 0.366555 0.024335 15.0627 < 2.2e-16 *** -#> feat 1.340699 0.359607 3.7282 0.0001928 *** -#> brandhiland -10.136219 0.584794 -17.3330 < 2.2e-16 *** -#> brandweight -1.749094 0.180721 -9.6784 < 2.2e-16 *** -#> brandyoplait 2.003848 0.143548 13.9594 < 2.2e-16 *** +#> scalePar 0.366555 0.024394 15.0267 < 2.2e-16 *** +#> feat 1.340699 0.359066 3.7338 0.0001886 *** +#> brandhiland -10.136219 0.586624 -17.2789 < 2.2e-16 *** +#> brandweight -1.749094 0.182142 -9.6029 < 2.2e-16 *** +#> brandyoplait 2.003848 0.143192 13.9941 < 2.2e-16 *** #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
WTP space modelsummary(mnl_wtp) #> ================================================= #> -#> Model estimated on: Tue Jun 27 21:11:50 2023 +#> Model estimated on: Sun Sep 24 18:54:45 2023 #> -#> Using logitr version: 1.1.0 +#> Using logitr version: 1.1.1 #> #> Call: #> logitr(data = yogurt, outcome = "choice", obsID = "obsID", pars = c("feat", @@ -332,15 +332,15 @@
WTP space model#> Summary Of Multistart Runs: #> Log Likelihood Iterations Exit Status #> 1 -2656.888 84 3 -#> 2 -2656.888 38 3 -#> 3 -2656.888 44 3 -#> 4 -2656.888 41 3 -#> 5 -2656.888 48 3 -#> 6 -2656.888 35 3 -#> 7 -2656.888 45 3 -#> 8 -2656.888 38 3 -#> 9 -2803.899 95 3 -#> 10 -2656.888 38 3 +#> 2 -2656.888 37 3 +#> 3 -2656.888 64 3 +#> 4 -2656.888 44 3 +#> 5 -2656.888 47 3 +#> 6 -2656.888 48 3 +#> 7 -2656.888 43 3 +#> 8 -2803.759 90 3 +#> 9 -2656.888 43 3 +#> 10 -2656.888 44 3 #> #> Use statusCodes() to view the meaning of each status code #> @@ -348,26 +348,26 @@
WTP space model#> #> Model Type: Multinomial Logit #> Model Space: Willingness-to-Pay -#> Model Run: 8 of 10 -#> Iterations: 38 -#> Elapsed Time: 0h:0m:0.13s +#> Model Run: 6 of 10 +#> Iterations: 48 +#> Elapsed Time: 0h:0m:0.15s #> Algorithm: NLOPT_LD_LBFGS #> Weights Used?: FALSE #> Robust? FALSE #> #> Model Coefficients: #> Estimate Std. Error z-value Pr(>|z|) -#> scalePar 0.366582 0.024366 15.0447 < 2.2e-16 *** -#> feat 1.340603 0.355868 3.7671 0.0001651 *** -#> brandhiland -10.135783 0.576092 -17.5940 < 2.2e-16 *** -#> brandweight -1.749083 0.179898 -9.7226 < 2.2e-16 *** -#> brandyoplait 2.003824 0.142377 14.0740 < 2.2e-16 *** +#> scalePar 0.366586 0.024366 15.0448 < 2.2e-16 *** +#> feat 1.340584 0.355865 3.7671 0.0001651 *** +#> brandhiland -10.135766 0.576092 -17.5940 < 2.2e-16 *** +#> brandweight -1.749031 0.179893 -9.7226 < 2.2e-16 *** +#> brandyoplait 2.003796 0.142378 14.0738 < 2.2e-16 *** #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> -#> Log-Likelihood: -2656.8878779 +#> Log-Likelihood: -2656.8878781 #> Null Log-Likelihood: -3343.7419990 -#> AIC: 5323.7757559 +#> AIC: 5323.7757561 #> BIC: 5352.7168000 #> McFadden R2: 0.2054148 #> Adj McFadden R2: 0.2039195 @@ -376,7 +376,7 @@
WTP space model
coef(mnl_wtp) #> scalePar feat brandhiland brandweight brandyoplait -#> 0.3665824 1.3406028 -10.1357831 -1.7490833 2.0038244
+#> scalePar 0.3665546 0.3665863 0.00003179 +#> feat 1.3406987 1.3405842 -0.00011446 +#> brandhiland -10.1362190 -10.1357665 0.00045253 +#> brandweight -1.7490940 -1.7490311 0.00006283 +#> brandyoplait 2.0038476 2.0037959 -0.00005172 +#> logLik -2656.8878790 -2656.8878781 0.00000094Compare WTP from both models @@ -395,12 +395,12 @@
Compare WTP from both models
wtpCompare(mnl_pref, mnl_wtp, scalePar = 'price') #> pref wtp difference -#> scalePar 0.3665546 0.3665824 0.00002782 -#> feat 1.3406987 1.3406028 -0.00009584 -#> brandhiland -10.1362190 -10.1357831 0.00043595 -#> brandweight -1.7490940 -1.7490833 0.00001069 -#> brandyoplait 2.0038476 2.0038244 -0.00002325 -#> logLik -2656.8878790 -2656.8878779 0.00000106
Here is a comparison of the log-likelihood for the weighted and unweighted models:
diff --git a/articles/mxl_models.html b/articles/mxl_models.html
index 0c6bbdf..8af73b7 100644
--- a/articles/mxl_models.html
+++ b/articles/mxl_models.html
@@ -44,7 +44,7 @@
citation("logitr")
-#>
#> To cite logitr in publications use:
#>
#> Helveston JP (2023). "logitr: Fast Estimation of Multinomial and
diff --git a/news/index.html b/news/index.html
index 034baaa..c2410da 100644
--- a/news/index.html
+++ b/news/index.html
@@ -17,7 +17,7 @@
convergence.Rmd
vignette to not run any actual code using other packages to fix issue on CRAN where not all packages are available on all platforms. Now the results are hard-coded in place.predict()
method to use the interval
and level
arguments of more standard predict()
methods.ci()
function.