Skip to content

Commit 5ae1a89

Browse files
Update README with performance and GPU information (#273)
Clarified performance comparison with other packages and improved GPU support details.
1 parent 1e16485 commit 5ae1a89

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This package estimates linear models with high dimensional categorical variables
66
The package is registered in the [`General`](https://github.com/JuliaRegistries/General) registry and so can be installed at the REPL with `] add FixedEffectModels`.
77

88
## Benchmarks
9-
The objective of the package is similar to the Stata command [`reghdfe`](https://github.com/sergiocorreia/reghdfe) and the R packages [`lfe`](https://cran.r-project.org/web/packages/lfe/lfe.pdf) and [`fixest`](https://lrberge.github.io/fixest/). The package is much faster than `reghdfe` or `lfe`. It also tends to be a bit faster than the more recent `fixest` (depending on the exact command). For complicated models, `FixedEffectModels` can also run on Nvidia GPUs for even faster performances (see below)
9+
The objective of the package is similar to the Stata command [`reghdfe`](https://github.com/sergiocorreia/reghdfe) and the R packages [`lfe`](https://cran.r-project.org/web/packages/lfe/lfe.pdf) and [`fixest`](https://lrberge.github.io/fixest/). The package is much faster than `reghdfe` (Stata) or `lfe` (R). It also tends to be a bit faster than the more recent `fixest` (R), especially when computing clustered standard errors. `FixedEffectModels` can also run on NVIDIA or Apple GPUs for even faster performances (see below)
1010

1111

1212
![benchmark](http://www.matthieugomez.com/files/fixedeffectmodels_benchmark.png)
@@ -123,34 +123,31 @@ Finally, you can use [RegressionTables.jl](https://github.com/jmboehm/Regression
123123
`FixedEffectModels` is multi-threaded. Use the option `nthreads` to select the number of threads to use in the estimation (defaults to `Threads.nthreads()`).
124124

125125
### GPUs
126-
The package has an experimental support for GPUs. This can make the package an order of magnitude faster for complicated problems.
126+
The package has an experimental support for GPUs. This can make the package 2x-5x faster for complicated problems.
127127

128-
If you have a Nvidia GPU, run `using CUDA` before `using FixedEffectModels`. Then, estimate a model with `method = :CUDA`.
128+
If you have a NVIDIA GPU, run `using CUDA` before `using FixedEffectModels`. Then, estimate a model with `method = :CUDA`.
129129
```julia
130-
using CUDA, FixedEffectModels
130+
using CUDA, FixedEffectModels, RDatasets
131131
@assert CUDA.functional()
132132
df = dataset("plm", "Cigar")
133133
reg(df, @formula(Sales ~ NDI + fe(State) + fe(Year)), method = :CUDA)
134134
```
135-
136-
The package also supports Apple GPUs with `Metal.jl`, although I could not find a way to get better performance
135+
If you have an Apple-designed GPU, run `using Metal` before `using FixedEffectModels`. Then, estimate a model with `method = :Metal`.
137136
```julia
138-
using Metal, FixedEffectModels
137+
using Metal, FixedEffectModels, RDatasets
139138
@assert Metal.functional()
140139
df = dataset("plm", "Cigar")
141140
reg(df, @formula(Sales ~ NDI + fe(State) + fe(Year)), method = :Metal)
142141
```
143142

144-
145-
146-
## Solution Method
143+
## Solution method
147144
Denote the model `y = X β + D θ + e` where X is a matrix with few columns and D is the design matrix from categorical variables. Estimates for `β`, along with their standard errors, are obtained in two steps:
148145

149146
1. `y, X` are regressed on `D` using the package [FixedEffects.jl](https://github.com/FixedEffects/FixedEffects.jl)
150-
2. Estimates for `β`, along with their standard errors, are obtained by regressing the projected `y` on the projected `X` (an application of the Frisch Waugh-Lovell Theorem)
147+
2. Estimates for `β`, along with their standard errors, are obtained by regressing the projected `y` on the projected `X` (an application of the Frisch Waugh-Lovell Theorem)
151148
3. With the option `save = true`, estimates for the high dimensional fixed effects are obtained after regressing the residuals of the full model minus the residuals of the partialed out models on `D` using the package [FixedEffects.jl](https://github.com/FixedEffects/FixedEffects.jl)
152149

153-
# References
150+
Here are some references for the solution method:
154151

155152
Baum, C. and Schaffer, M. (2013) *AVAR: Stata module to perform asymptotic covariance estimation for iid and non-iid data robust to heteroskedasticity, autocorrelation, 1- and 2-way clustering, and common cross-panel autocorrelated disturbances*. Statistical Software Components, Boston College Department of Economics.
156153

0 commit comments

Comments
 (0)