Skip to content

Commit

Permalink
v0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pachadotdev committed May 26, 2024
1 parent bb177b8 commit 342ceea
Show file tree
Hide file tree
Showing 36 changed files with 273 additions and 229 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: capybara
Type: Package
Title: Fast and Memory Efficient Fitting of Linear Models With High-Dimensional
Fixed Effects
Version: 0.4.6
Version: 0.5.0
Authors@R: c(
person(
given = "Mauricio",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# capybara 0.5.0

* Avoids for loops in the C++ code, and instead uses Armadillo's functions.
* O(n) computations in C++ access data directly by using pointers.

# capybara 0.4.6

* Fixes notes from tidyselect regarding the use of `all_of()`.
Expand Down
28 changes: 14 additions & 14 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ See the documentation in progress: https://pacha.dev/capybara.

## Design choices

Capybara uses C++ to address some bottlenecks. It also uses data.table because
it allows me to use hash tables.
Capybara uses C++ and vectorized R operations to address bottlenecks. Some
parts of the code use dplyr, which allows me to write code that is easier to
understand and it works very well to performed grouped operations.

I tried to implement an important lesson between v0.1 and v0.2: "He who gives up
[code] safety for [code] speed deserves neither." (Wickham, 2014).
Expand Down Expand Up @@ -110,8 +111,7 @@ UofT's servers a bit less.

## Future plans

I will also work on adding a RESET test to summaries as default and make
clustered standard errors computation a bit easier.
I will also work on adding a RESET test to summaries.

This also needs lots of tests. There are a few in the dev folder, but I need
to test with testthat.
Expand All @@ -123,19 +123,19 @@ Median time for the different models in the book

|package | PPML| Trade Diversion| Endogeneity| Reverse Causality| Non-linear/Phasing Effects| Globalization|
|:------------|-------:|---------------:|-----------:|-----------------:|--------------------------:|-------------:|
|Alpaca | 213.4ms| 2.3s| 1.35s| 1.86s| 2.59s| 4.96s|
|Base R | 1.5m | 1.53m| 23.43m| 23.52m| 23.16m| 24.85m|
|**Capybara** | 337ms | 3.19s| 1.37s| 1.74s| 2.66s| 4.65s|
|Fixest | 67.4ms| 477.08ms| 95.88ms| 136.21ms| 206.12ms| 415.31ms|
|Alpaca | 346.4ms| 2.52s| 1.51s| 1.9s | 2.96s| 5.57s|
|Base R | 1.5m | 1.53m| 23.43m| 23.52m | 23.16m| 24.85m|
|**Capybara** | 440ms| 2.86s| 1.92s| 2.29s | 2.94s| 4.46s|
|Fixest | 64.9ms| 503ms| 106.14ms| 145.04ms| 243.61ms| 524.7ms|

Memory allocation for the same models

|package | PPML| Trade Diversion| Endogeneity| Reverse Causality| Non-linear/Phasing Effects| Globalization|
|:------------|--------:|---------------:|-----------:|-----------------:|--------------------------:|-------------:|
|Alpaca | 304.8MB | 339.8MB| 306.3MB| 335.61MB| 393.86MB| 539.49MB|
|Base R | 2.73GB| 2.6GB| 11.9GB| 11.94GB| 11.95GB| 11.97GB|
|**Capybara** | 210MB | 235MB| 241MB| 249MB| 263MB| 299MB|
|Fixest | 44.59MB| 36.59MB| 28.1MB| 32.43MB| 41.12MB| 62.87MB|
|package | PPML| Trade Diversion| Endogeneity| Reverse Causality| Non-linear/Phasing Effects| Globalization|
|:------------|-------:|---------------:|-----------:|-----------------:|--------------------------:|-------------:|
|Alpaca | 306MB| 340.8MB| 306.4MB| 335.9MB| 394.6MB| 541.3MB|
|Base R | 2.7GB| 2.6GB| 11.9GB| 11.92GB| 11.95GB| 11.97GB|
|**Capybara** | 210MB| 235MB| 241MB| 249MB| 263MB| 299MB|
|Fixest | 44.4MB| 36.4MB| 27.9MB| 32.2MB| 40.9MB| 62.7MB|

# Debugging

Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ See the documentation in progress: <https://pacha.dev/capybara>.

## Design choices

Capybara uses C++ to address some bottlenecks. It also uses data.table
because it allows me to use hash tables.
Capybara uses C++ and vectorized R operations to address bottlenecks.
Some parts of the code use dplyr, which allows me to write code that is
easier to understand and it works very well to performed grouped
operations.

I tried to implement an important lesson between v0.1 and v0.2: “He who
gives up \[code\] safety for \[code\] speed deserves neither.” (Wickham,
Expand Down Expand Up @@ -104,8 +106,7 @@ UofT’s servers a bit less.

## Future plans

I will also work on adding a RESET test to summaries as default and make
clustered standard errors computation a bit easier.
I will also work on adding a RESET test to summaries.

This also needs lots of tests. There are a few in the dev folder, but I
need to test with testthat.
Expand All @@ -118,19 +119,19 @@ Analysis](https://www.wto.org/english/res_e/publications_e/advancedguide2016_e.h

| package | PPML | Trade Diversion | Endogeneity | Reverse Causality | Non-linear/Phasing Effects | Globalization |
| :----------- | ------: | --------------: | ----------: | ----------------: | -------------------------: | ------------: |
| Alpaca | 213.4ms | 2.3s | 1.35s | 1.86s | 2.59s | 4.96s |
| Alpaca | 346.4ms | 2.52s | 1.51s | 1.9s | 2.96s | 5.57s |
| Base R | 1.5m | 1.53m | 23.43m | 23.52m | 23.16m | 24.85m |
| **Capybara** | 337ms | 3.19s | 1.37s | 1.74s | 2.66s | 4.65s |
| Fixest | 67.4ms | 477.08ms | 95.88ms | 136.21ms | 206.12ms | 415.31ms |
| **Capybara** | 440ms | 2.86s | 1.92s | 2.29s | 2.96s | 4.46s |
| Fixest | 64.9ms | 503ms | 106.14ms | 145.04ms | 243.61ms | 524.7ms |

Memory allocation for the same models

| package | PPML | Trade Diversion | Endogeneity | Reverse Causality | Non-linear/Phasing Effects | Globalization |
| :----------- | ------: | --------------: | ----------: | ----------------: | -------------------------: | ------------: |
| Alpaca | 304.8MB | 339.8MB | 306.3MB | 335.61MB | 393.86MB | 539.49MB |
| Base R | 2.73GB | 2.6GB | 11.9GB | 11.94GB | 11.95GB | 11.97GB |
| **Capybara** | 210MB | 235MB | 241MB | 249MB | 263MB | 299MB |
| Fixest | 44.59MB | 36.59MB | 28.1MB | 32.43MB | 41.12MB | 62.87MB |
| package | PPML | Trade Diversion | Endogeneity | Reverse Causality | Non-linear/Phasing Effects | Globalization |
| :----------- | -----: | --------------: | ----------: | ----------------: | -------------------------: | ------------: |
| Alpaca | 306MB | 340.8MB | 306.4MB | 335.9MB | 394.6MB | 541.3MB |
| Base R | 2.7GB | 2.6GB | 11.9GB | 11.92GB | 11.95GB | 11.97GB |
| **Capybara** | 210MB | 235MB | 241MB | 249MB | 263MB | 299MB |
| Fixest | 44.4MB | 36.4MB | 27.9MB | 32.2MB | 40.9MB | 62.7MB |

# Debugging

Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/intro.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 41 additions & 41 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ pkgdown: 2.0.7
pkgdown_sha: ~
articles:
intro: intro.html
last_built: 2024-05-19T23:41Z
last_built: 2024-05-26T04:05Z

4 changes: 2 additions & 2 deletions docs/reference/apes.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 342ceea

Please sign in to comment.