Skip to content

Commit 7fb5893

Browse files
committed
0.0.4 updates
- Changed license to MIT (after doing a bit of reading up on this) - Added placeholder hex sticker
1 parent f8b1c49 commit 7fb5893

File tree

11 files changed

+53911
-614
lines changed

11 files changed

+53911
-614
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
^pkgdown$
77
^\.github$
88
vignettes/children
9+
^README\.Rmd$
910
^LICENSE\.md$
1011
^logitr\.Rproj$
1112
^doc$

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Authors@R: c(
99
email = "john.helveston@gmail.com",
1010
comment = c(ORCID = "0000-0002-2657-9191")))
1111
Description: logitr estimates multinomial (MNL) and mixed logit (MXL) models in R. Models can be estimated using "Preference" space or "Willingness-to-pay" (WTP) space utility parameterizations. The program includes an option to run a multistart optimization loop with random starting points in each iteration, which is useful for non-convex problems like MXL models or models with WTP space utility parameterizations. The main optimization loop uses the nloptr function to minimize the negative log-likelihood function. The package has additional functions for computing and comparing WTP from both preference space and WTP space models and for simulating the expected shares of a set of alternatives using an estimated model.
12-
License: GPL-3
12+
License: MIT + file LICENSE
1313
Encoding: UTF-8
1414
LazyData: true
1515
Roxygen: list(markdown = TRUE)

LICENSE

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
YEAR: 2014-2020
2+
COPYRIGHT HOLDER: John Paul Helveston

LICENSE.md

+21-595
Large diffs are not rendered by default.

NEWS.md

+32-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,41 @@
1-
# logitr 0.0.3: New simulation functionality
1+
# logitr 0.0.4
2+
3+
Weighted models, new dataset, new encoding features
4+
5+
## Summary of larger updates:
6+
7+
- Added support for estimating weighted regressions
8+
- Added and improved documentation for new datasets: `yogurt`, `cars_china`, `cars_us`
9+
- Exported the `dummyCode()` function for automatically creating dummy-coded variables in a data frame.
10+
- Added support for auto dummy-coding categorical variables prior to model estimation
11+
- Major overhaul of documentation using {pkgdown}
12+
13+
## Summary of smaller updates:
14+
15+
- Changed license to MIT (after doing a bit of reading up on this)
16+
- Fixed dimension-matching issue with user-provided draws for mixed logit models
17+
- Fixed bug in `modelInputs` where `obsID` was not a vector for tibble inputs
18+
- Added placeholder hex sticker
19+
20+
21+
# logitr 0.0.3
22+
23+
New simulation functionality
224

325
## Summary of larger updates:
426

5-
* Added support for simulating shares for a set of alternatives given an estimated model: `simulateShares()`. This is similar to the `predict()` function in mlogit.
6-
* Removed support for using an estimated preference space model as an input in the `options()` function. I found this just far too confusing, and instead encourage users to supply a WTP space model with the computed WTP from a preference space model as starting parameters.
27+
- Added support for simulating shares for a set of alternatives given an estimated model: `simulateShares()`. This is similar to the `predict()` function in mlogit.
28+
- Removed support for using an estimated preference space model as an input in the `options()` function. I found this just far too confusing, and instead encourage users to supply a WTP space model with the computed WTP from a preference space model as starting parameters.
729

830
## Summary of smaller updates:
931

10-
* Updated the `summary()` and main `logitr()` functions to keep the basic information (run #, log-likelihood value, number of iterations, and output status) whenever `numMultistarts` > 1. Previously this information was only kept if `keepAllRuns` was set to `TRUE`.
32+
- Updated the `summary()` and main `logitr()` functions to keep the basic information (run #, log-likelihood value, number of iterations, and output status) whenever `numMultistarts` > 1. Previously this information was only kept if `keepAllRuns` was set to `TRUE`.
33+
1134

1235

36+
# logitr 0.0.2
1337

14-
# logitr 0.0.2: Updates to options and a few small bug fixes
38+
Updates to options and a few small bug fixes
1539

1640
## Summary of larger updates:
1741

@@ -38,6 +62,8 @@ getting the right logLik value too.
3862

3963

4064

41-
# logitr 0.0.1: Full reboot of logitr!
65+
# logitr 0.0.1
66+
67+
Full reboot of logitr!
4268

4369
Long overdue, I decided to give the logitr program a full overhaul. This is the first version that is compiled as a proper R package that can be directly installed from Github. This version is much more robust and flexible than the prior, clunky collection of R files that I had previously been using to estimate logit models.

README.Rmd

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
output: github_document
3+
---
4+
5+
<!-- README.md is generated from README.Rmd. Please edit that file -->
6+
7+
```{r, include = FALSE}
8+
knitr::opts_chunk$set(
9+
collapse = TRUE,
10+
warning = FALSE,
11+
message = FALSE,
12+
comment = "#>",
13+
fig.path = "man/figures/",
14+
fig.retina = 3
15+
)
16+
```
17+
18+
# logitr <a href='https://jhelvy.github.io/logitr/'><img src='man/figures/logitr-hex.png' align="right" height="139" /></a>
19+
20+
<!-- badges: start -->
21+
[![Lifecycle:
22+
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
23+
[![CRAN
24+
status](https://www.r-pkg.org/badges/version/logitr)](https://CRAN.R-project.org/package=logitr)
25+
<!-- badges: end -->
26+
27+
**logitr** estimates multinomial (MNL) and mixed logit (MXL) models in
28+
R. Models can be estimated using “Preference” space or
29+
“Willingness-to-pay” (WTP) space [utility
30+
parameterizations](https://jhelvy.github.io/logitr/articles/utility_models.html).
31+
The current version includes support for:
32+
33+
- Homogeneous multinomial logit (MNL) models
34+
- Heterogeneous mixed logit (MXL) models (with normal and log-normal parameter distributions).
35+
- Preference space utility parameterization.
36+
- WTP space utility parameterization.
37+
- An optional multistart optimization that uses different random starting points in each iteration (useful for non-convex problems like MXL models or models with WTP space parameterizations).
38+
39+
The package also has additional functions for:
40+
41+
- Computing and comparing WTP from both preference space and WTP space models.
42+
- Simulating the expected shares of a set of alternatives using an estimated model.
43+
44+
Note: MXL models assume uncorrelated heterogeneity covariances and are estimated using maximum simulated likelihood based on the algorithms in [Kenneth Train’s](http://eml.berkeley.edu/~train/) book [*Discrete Choice Methods with Simulation, 2nd Edition (New York: Cambridge University Press, 2009)*](http://eml.berkeley.edu/books/choice2.html).
45+
46+
View the [basic usage](https://jhelvy.github.io/logitr/articles/basic_usage.html) page for details on how to use **logitr** to estimate models.
47+
48+
## Installation
49+
50+
The current version is not yet on CRAN, but you can install it from
51+
Github using the **devtools** library:
52+
53+
```{r, eval=FALSE}
54+
devtools::install_github("jhelvy/logitr")
55+
```
56+
57+
Load the library with:
58+
```{r, eval=FALSE}
59+
library(logitr)
60+
```
61+
62+
## Required Libraries
63+
64+
**logitr** requires the [**nloptr**](https://cran.r-project.org/web/packages/nloptr/index.html) library. This is because `nloptr()` allows for both the objective and gradient functions to be computed in a single function. This speeds up computation time considerably because both the objective and gradient functions require many of the same calculations (e.g. computing probabilities).
65+
66+
## Author, Version, and License Information
67+
68+
- Author: *John Paul Helveston* [www.jhelvy.com](http://www.jhelvy.com/)
69+
- Date First Written: *Sunday, September 28, 2014*
70+
- Most Recent Update: `r format(Sys.Date(), format="%B %d %Y")`
71+
- License: [MIT](https://github.com/jhelvy/logitr/blob/master/LICENSE.md)
72+
- [Latest Release](https://github.com/jhelvy/logitr/releases/latest): 0.0.4
73+
74+
# Citation Information
75+
76+
If you use this package for in a publication, I would greatly appreciate it if you cited it. You can get the citation information by typing `citation("logitr")` into R:
77+
78+
```{r}
79+
citation("logitr")
80+
```

README.md

+39-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11

2-
# logitr
2+
<!-- README.md is generated from README.Rmd. Please edit that file -->
3+
4+
# logitr <a href='https://jhelvy.github.io/logitr/'><img src='man/figures/logitr-hex.png' align="right" height="139" /></a>
35

46
<!-- badges: start -->
57

68
[![Lifecycle:
79
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
810
[![CRAN
911
status](https://www.r-pkg.org/badges/version/logitr)](https://CRAN.R-project.org/package=logitr)
10-
1112
<!-- badges: end -->
1213

1314
**logitr** estimates multinomial (MNL) and mixed logit (MXL) models in
@@ -47,7 +48,15 @@ for details on how to use **logitr** to estimate models.
4748
The current version is not yet on CRAN, but you can install it from
4849
Github using the **devtools** library:
4950

50-
devtools::install_github("jhelvy/logitr")
51+
``` r
52+
devtools::install_github("jhelvy/logitr")
53+
```
54+
55+
Load the library with:
56+
57+
``` r
58+
library(logitr)
59+
```
5160

5261
## Required Libraries
5362

@@ -59,19 +68,38 @@ computation time considerably because both the objective and gradient
5968
functions require many of the same calculations (e.g. computing
6069
probabilities).
6170

62-
# Author, Version, and License Information
71+
## Author, Version, and License Information
6372

6473
- Author: *John Paul Helveston*
6574
[www.jhelvy.com](http://www.jhelvy.com/)
6675
- Date First Written: *Sunday, September 28, 2014*
67-
- Most Recent Update: *Thursday, Oct 22, 2020*
68-
- License: GPL-3
69-
- Latest Version: 1.2.0
76+
- Most Recent Update: December 04 2020
77+
- License:
78+
[MIT](https://github.com/jhelvy/logitr/blob/master/LICENSE.md)
79+
- [Latest Release](https://github.com/jhelvy/logitr/releases/latest):
80+
0.0.4
7081

7182
# Citation Information
7283

7384
If you use this package for in a publication, I would greatly appreciate
74-
it if you cited it. You can get the citation information by typing this
75-
into R:
76-
77-
citation('logitr')
85+
it if you cited it. You can get the citation information by typing
86+
`citation("logitr")` into R:
87+
88+
``` r
89+
citation("logitr")
90+
#>
91+
#> To cite logitr in publications use:
92+
#>
93+
#> John Paul Helveston. logitr: Random utility logit models with
94+
#> preference and willingness to pay space parameterizations (2020)
95+
#>
96+
#> A BibTeX entry for LaTeX users is
97+
#>
98+
#> @Manual{,
99+
#> title = {logitr: Random utility logit models with preference and willingness to pay space parameterizations},
100+
#> author = {John Paul Helveston},
101+
#> year = {2020},
102+
#> note = {R package version 0.0.4},
103+
#> url = {https://jhelvy.github.io/logitr/},
104+
#> }
105+
```

build.R

+23
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,26 @@ help(package = 'logitr')
1616

1717
# Install from github
1818
# devtools::install_github('jhelvy/logitr')
19+
20+
21+
# Make hex sticker --------------------
22+
23+
library(hexSticker)
24+
library(latex2exp)
25+
library(ggplot2)
26+
library(showtext)
27+
p <- ggplot() +
28+
theme_void() +
29+
theme_transparent() +
30+
annotate(
31+
geom = "text", x = 0, y = 0,
32+
label = TeX('$\\hat{\\omega} = \\frac{\\hat{\\beta}}{\\hat{\\alpha}}$'),
33+
size = 6)
34+
font_add_google("Fira Sans Condensed")
35+
showtext_auto()
36+
sticker(p,
37+
package = "logitr",
38+
h_fill = "#d9d9d9", h_color = "#007bff",
39+
p_color = "black", p_size = 10,
40+
s_x = 1, s_y = .75, s_width = 1, s_height=1,
41+
p_family = "Fira Sans Condensed", filename = "man/figures/logitr-hex.png")

inst/CITATION

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ citEntry(
55
title = "logitr: Random utility logit models with preference and willingness to pay space parameterizations",
66
author = "John Paul Helveston",
77
year = "2020",
8-
note = "R package version 1.2.0",
8+
note = "R package version 0.0.4",
99
url = "https://jhelvy.github.io/logitr/",
1010
textVersion = "John Paul Helveston. logitr: Random utility logit models with preference and willingness to pay space parameterizations (2020)"
1111
)

man/figures/logitr-hex.png

40.9 KB
Loading

0 commit comments

Comments
 (0)