Skip to content

Commit

Permalink
improve convergence algo, fixes: #323
Browse files Browse the repository at this point in the history
  • Loading branch information
lrberge committed Feb 14, 2024
1 parent e791dc3 commit 27dff74
Show file tree
Hide file tree
Showing 12 changed files with 239 additions and 155 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

## New features

- **the demeaning algorithm has been reworked!** The code has been condensed and four new parameters have been introduced to control the details of how the algorithm works. The new default values should lead to quicker convergence in general (for difficult cases). The new function `demeaning_algo` gives the user fine control over the internal parameters of the algorithm.

- all estimation functions gain the argument `data.save`. If `TRUE`, the data set used for the estimation is saved in the returned object. This ensures the consistency of post-processing (like fit statistics, predict, etc) even if the original data has been modified in the meantime. Suggestion by Vincent Arel-Bundock, #340

- new function `fixest_data` to access the original data set used at estimation-time. Suggestion by Kyle Butts, #465
Expand All @@ -28,6 +30,8 @@
- fix bug in `predict` when the `offset` was placed in a formula and not passed as a regular argument. Reported by @jl-flores, #309

- fix bug in TSLS estimations when the formula contained multiple LHS to be expanded with the dot square bracket operator. Reported by @svraka, #395

- fix bug leading to the absence of warning when the convergence of the demeaning algorithm failed. Thanks to @ja-ortiz-uniandes, #323

## Improvements

Expand Down
2 changes: 1 addition & 1 deletion R/miscfuns.R
Original file line number Diff line number Diff line change
Expand Up @@ -3319,7 +3319,7 @@ fixest_data = function(x, sample = "original"){
#' two largest FEs before applying the demeaning over all FEs can improve convergence speed.
#' This is controlled with the argument `iter_warmup` which gives the number of iterations
#' over all the FEs to run before going to the 2 FEs demeaning. By default, the deameaning
#' over all FEs is run for 15 iterations before switching to the 2 FEs case. #'
#' over all FEs is run for 15 iterations before switching to the 2 FEs case.
#'
#' The above defaults are the outcome of extended empirical applications, and try to strike a
#' balance across a majority of cases. Of course you can always get better results by tailoring
Expand Down
3 changes: 2 additions & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ reference:
- weights.fixest
- formula.fixest
- terms.fixest
- df.residual.fixest
- title: Formula tools
desc: Tools to manipulate formulas
contents:
Expand All @@ -98,7 +99,7 @@ reference:
desc: User-level versions of internal tools
contents:
- demean
- demean_algo
- demeaning_algo
- to_integer
- bin
- ref
Expand Down
1 change: 1 addition & 0 deletions docs/reference/demean.html

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

10 changes: 6 additions & 4 deletions docs/reference/etable.html

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

Loading

0 comments on commit 27dff74

Please sign in to comment.