Skip to content

Commit add82ae

Browse files
authored
Merge pull request #114 from s3alfisc/dev
v0.14
2 parents 7d33427 + 77f0243 commit add82ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3151
-1568
lines changed

Diff for: .github/workflows/R-CMD-check.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181

8282
# install WildBootTests.jl
8383
- name: install WildBootTests.jl
84-
run: julia -e 'using Pkg; Pkg.add(["WildBootTests", "StableRNGs"])'
84+
run: julia -e 'using Pkg; Pkg.add(["StableRNGs"]); Pkg.add(Pkg.PackageSpec(;name="WildBootTests", version="0.9.9"))'
8585
# use shell bash to ensure consistent behavior across OS
8686
shell: bash
8787

Diff for: DESCRIPTION

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
Package: fwildclusterboot
22
Title: Fast Wild Cluster Bootstrap Inference for Linear Models
3-
Version: 0.13.2
3+
Version: 0.14.0
44
Authors@R: c(
55
person("Alexander", "Fischer", , "[email protected]", role = c("aut", "cre")),
66
person("David", "Roodman", role = "aut"),
7+
person("Megha", "Joshi",
8+
role = "rev",
9+
comment = "Megha reviewed the package (v. 0.13) for ropensci
10+
, see <https://github.com/ropensci/software-review/issues/546>"
11+
),
12+
person("Eunseop", "Kim",
13+
role = "rev",
14+
comment = "Eunseop reviewed the package (v. 0.13) for ropensci
15+
, see <https://github.com/ropensci/software-review/issues/546>"
16+
),
717
person("Achim", "Zeileis", role = "ctb",
818
comment = "Author of included sandwich fragments"),
919
person("Nathaniel", "Graham", role = "ctb",
@@ -42,7 +52,6 @@ Imports:
4252
generics,
4353
gtools,
4454
JuliaConnectoR,
45-
MASS,
4655
Matrix,
4756
Rcpp,
4857
rlang,
@@ -64,7 +73,8 @@ Suggests:
6473
rmarkdown,
6574
sandwich,
6675
testthat (>= 3.0.0),
67-
tibble
76+
tibble,
77+
MASS
6878
LinkingTo:
6979
Rcpp,
7080
RcppArmadillo,
@@ -77,9 +87,9 @@ Language: en-US
7787
LazyData: true
7888
Roxygen: list(markdown = TRUE, roclets = c ("namespace", "rd",
7989
"srr::srr_stats_roclet"))
80-
RoxygenNote: 7.2.1
90+
RoxygenNote: 7.2.3
8191
SystemRequirements: Version Requirements to run the wild bootstrap through
82-
Julia - Julia (>= 1.8), WildBootTests.jl (>=0.9). Julia is
92+
Julia - Julia (>= 1.8), WildBootTests.jl (>=0.9.8). Julia is
8393
downloadable via the official Julia website
8494
(https://julialang.org/downloads/), WildBootTests.jl via Julia's
8595
package manager (https://docs.julialang.org/en/v1/stdlib/Pkg/) or its

Diff for: NAMESPACE

+7-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ S3method(mboottest,lm)
1313
S3method(nobs,boottest)
1414
S3method(nobs,mboottest)
1515
S3method(plot,boottest)
16-
S3method(print,boottest)
17-
S3method(print,mboottest)
1816
S3method(pval,boottest)
1917
S3method(pval,mboottest)
2018
S3method(summary,boottest)
@@ -34,12 +32,18 @@ export(teststat)
3432
export(tidy)
3533
importFrom(JuliaConnectoR,juliaEval)
3634
importFrom(JuliaConnectoR,juliaImport)
37-
importFrom(MASS,ginv)
3835
importFrom(Matrix,Diagonal)
36+
importFrom(Matrix,Matrix)
37+
importFrom(Matrix,crossprod)
38+
importFrom(Matrix,sparse.model.matrix)
39+
importFrom(Matrix,t)
40+
importFrom(Matrix,tcrossprod)
3941
importFrom(Rcpp,evalCpp)
4042
importFrom(collapse,GRP)
43+
importFrom(collapse,fmean)
4144
importFrom(collapse,fsum)
4245
importFrom(collapse,qF)
46+
importFrom(collapse,qtab)
4347
importFrom(dqrng,dqsample)
4448
importFrom(dqrng,dqset.seed)
4549
importFrom(dreamerr,check_arg)

Diff for: NEWS.md

+35-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
1+
# fwildclusterboot 0.14
2+
3+
## Breaking Changes
4+
5+
- the `print.boottest()` and `print.mboottest()` method have been deprecated, as both did not have a distinct use case.
6+
- Bugfix: `boottest()` should never have run with `fixest::feols()` and
7+
varying slopes syntax via `var1[var2]`. Unfortunately it did for the heteroskedastic bootstrap - it's a bug. I am very sorry if you are affected by this! This version adds an error message for this case.
8+
9+
## Performance
10+
11+
Version 0.14 ...
12+
13+
- sparsifies the "fast and reliable" bootstraps - bootstrap types 31, 33, 13 (which leads to good speed gains for problems with high dimensional fixed effects)
14+
- allows to project out cluster fixed effects when running the "fast and reliable" algorithms "11" and "31"
15+
- computes the generalized inverse `pinv` via rcpp eigen instead of `MASS::ginv()` whenever `Matrix::solve()` fails
16+
- unlocks parallelization (nthreads was internally set to 1 for some reason)
17+
18+
19+
## rOpenSci Review feedback
20+
21+
- update docs:
22+
- add a vignette on wild bootstrap concepts (wild bootstrap 101)
23+
- better explanation of plot method in docs and vignette
24+
- some guidelines on how to turn messages and warnings off
25+
- reorganization of ropensci ssr tags into code
26+
- it is now possible to interrupt rcpp loops
27+
28+
29+
## Misc
30+
31+
- throws a clear error message when the subcluster bootstrap is tried for the fast and reliable algos (currently not supported)
32+
- bumps the required `WildBootTests.jl` version to `0.9.7`
33+
34+
135
# fwildclusterboot 0.13
236

337
## Potentially Breaking Changes:
@@ -308,7 +342,7 @@ I have spent some time to clean up `fwildclusterboot's` internals, which should
308342
+ Bug fix: for one-sided hypotheses for the WRU bootstrap (if impose_null = FALSE), the returned p-values were incorrect - they were reported as 'p', but should have been '1-p'. E.g. if the reported p-values was reported as 0.4, it should have been reported as 0.6.
309343
+ A new function argument `ssc` gives more control over the small sample adjustments made within `boottest()`. It closely mirrors the `ssc` argument in `fixest`. The only difference is that `fwildclusterboot::boot_ssc()'s` `fixef.K` argument currently has only one option, `'none'`, which means that the fixed effect parameters are discarded when calculating the number of estimated parameters k.
310344
The default argument of `boot_ssc()` are `adj = TRUE, fixef.K = "none", cluster.adj = TRUE` and `cluster.df = "conventional"`. In fixest, the `cluster.df` argument is `"min"` by default.
311-
Prior to v 0.6, by default, no small sample adjustments regarding the sample size N and the number of estimated parameters k were applied. The changes in v0.6 may slightly affect the output of `boottest()`. For exact reproducibility of previous results, set `adj = FALSE`. Setting `adj = TRUE` will not affect p-values and confidence intervals for *oneway clustering*, but the internally calculated t-stat, which is divided by $\sqrt{(N-k)/(N-1)}$. For *twoway* clustering, it might affect the number and order of invalid bootstrapped t-statistics (due to non-positive definite covariance matrices) and, through this channel, affect bootstrapped inferential parameters.
345+
Prior to v 0.6, by default, no small sample adjustments regarding the sample size N and the number of estimated parameters k were applied. The changes in v0.6 may slightly affect the output of `boottest()`. For exact reproducibility of previous results, set `adj = FALSE`. Setting `adj = TRUE` will not affect p-values and confidence intervals for *oneway clustering*, but the internally calculated t-stat, which is divided by sqrt(N-k)/(N-1). For *twoway* clustering, it might affect the number and order of invalid bootstrapped t-statistics (due to non-positive definite covariance matrices) and, through this channel, affect bootstrapped inferential parameters.
312346

313347
+ Testing: unit tests are now run on [github actions](https://github.com/s3alfisc/fwildclusterboot/actions/workflows/R-CMD-check.yaml) against [wildboottestjlr](https://github.com/s3alfisc/wildboottestjlr), which is a [JuliaConnectoR](https://github.com/stefan-m-lenz/JuliaConnectoR) based wrapper around [WildBootTests.jl](https://github.com/droodman/WildBootTests.jl), a Julia implementation of the fast wild cluster bootstrap algorithm.
314348
+ Additionally, minor speed tweaks.

Diff for: R/RcppExports.R

+22
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,24 @@ boot_algo3_crv3 <- function(B, G, k, v, scores_mat, scores_boot, inv_tXX_tXgXg,
99
.Call('_fwildclusterboot_boot_algo3_crv3', PACKAGE = 'fwildclusterboot', B, G, k, v, scores_mat, scores_boot, inv_tXX_tXgXg, cores, R, delta_b_star)
1010
}
1111

12+
convertSparse <- function(mat) {
13+
.Call('_fwildclusterboot_convertSparse', PACKAGE = 'fwildclusterboot', mat)
14+
}
15+
16+
compute_H <- function(G, R, tXXinv, tXgXg, scores_list, cores) {
17+
.Call('_fwildclusterboot_compute_H', PACKAGE = 'fwildclusterboot', G, R, tXXinv, tXgXg, scores_list, cores)
18+
}
19+
20+
pinv <- function(X) {
21+
.Call('_fwildclusterboot_pinv', PACKAGE = 'fwildclusterboot', X)
22+
}
23+
24+
#' Moore-Penrose Pseudo Inverses via Eigen
25+
#' @param A a matrix
26+
#' @return A matrix. Pseudo-Inverse of A.
27+
#' @noRd
28+
NULL
29+
1230
#' Matrix Multiplication via Eigen
1331
#' @param A A matrix.
1432
#' @param B A matrix.
@@ -19,6 +37,10 @@ eigenMapMatMult <- function(A, B, nthreads) {
1937
.Call('_fwildclusterboot_eigenMapMatMult', PACKAGE = 'fwildclusterboot', A, B, nthreads)
2038
}
2139

40+
eigen_pinv <- function(A) {
41+
.Call('_fwildclusterboot_eigen_pinv', PACKAGE = 'fwildclusterboot', A)
42+
}
43+
2244
#' Get maximum number of threads on hardware for open mp support
2345
#' @noRd
2446
cpp_get_nb_threads <- function() {

0 commit comments

Comments
 (0)