You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-12Lines changed: 9 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ This package estimates linear models with high dimensional categorical variables
6
6
The package is registered in the [`General`](https://github.com/JuliaRegistries/General) registry and so can be installed at the REPL with `] add FixedEffectModels`.
7
7
8
8
## 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)
@@ -123,34 +123,31 @@ Finally, you can use [RegressionTables.jl](https://github.com/jmboehm/Regression
123
123
`FixedEffectModels` is multi-threaded. Use the option `nthreads` to select the number of threads to use in the estimation (defaults to `Threads.nthreads()`).
124
124
125
125
### 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.
127
127
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`.
129
129
```julia
130
-
using CUDA, FixedEffectModels
130
+
using CUDA, FixedEffectModels, RDatasets
131
131
@assert CUDA.functional()
132
132
df =dataset("plm", "Cigar")
133
133
reg(df, @formula(Sales ~ NDI +fe(State) +fe(Year)), method =:CUDA)
134
134
```
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`.
137
136
```julia
138
-
using Metal, FixedEffectModels
137
+
using Metal, FixedEffectModels, RDatasets
139
138
@assert Metal.functional()
140
139
df =dataset("plm", "Cigar")
141
140
reg(df, @formula(Sales ~ NDI +fe(State) +fe(Year)), method =:Metal)
142
141
```
143
142
144
-
145
-
146
-
## Solution Method
143
+
## Solution method
147
144
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:
148
145
149
146
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)
151
148
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)
152
149
153
-
# References
150
+
Here are some references for the solution method:
154
151
155
152
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.
0 commit comments