Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.14 #114

Merged
merged 59 commits into from
Jul 8, 2023
Merged

v0.14 #114

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
9e8c1c8
add Megha as a reviewer
s3alfisc Apr 29, 2023
7e4d1f8
skeleton FAQ vignette
s3alfisc Apr 29, 2023
0c69619
initial sparsification of algos #116
s3alfisc May 21, 2023
0225c69
add eunseop to reviewers
s3alfisc May 31, 2023
932b154
add pkgcheck workflow
s3alfisc May 31, 2023
f07372e
fix description
s3alfisc Jun 8, 2023
a98e711
add sparse matrix support for MNW bootstrap algo #116
s3alfisc Jun 8, 2023
d940db1
more sparse matrix support for MNW algos #118
s3alfisc Jun 8, 2023
b69217b
fix bug in plot method when no conf int is computed
s3alfisc Jun 9, 2023
7a00a08
faster Moore Penrose inverses via pinv
s3alfisc Jun 10, 2023
108af9d
allow to interrupt cpp loops #119
s3alfisc Jun 10, 2023
de5716d
add tests for pinv function
s3alfisc Jun 10, 2023
7981344
cpp interruption - forgot semicolons everywhere
s3alfisc Jun 10, 2023
c899643
bump to 0.13.3
s3alfisc Jun 10, 2023
ac43c69
add eigen_pinv support (large speed gains)
s3alfisc Jun 11, 2023
902dbed
test against wildboottest 0.9.0
s3alfisc Jun 17, 2023
e0360be
delete print method
s3alfisc Jun 17, 2023
a74de20
fix eigen_pinv bug
s3alfisc Jun 17, 2023
a2af254
drop support for print.mboottest
s3alfisc Jun 17, 2023
7ff50e6
update ropensci srr tags 1.0
s3alfisc Jun 17, 2023
2b9eeb6
update plot documentation
s3alfisc Jun 17, 2023
650ed3c
add info on how to turn off warn and messages
s3alfisc Jun 17, 2023
cf7be51
update section on plot method in vignette #122
s3alfisc Jun 17, 2023
d63856a
enforce pvalues, tstats to be a a flat vector
s3alfisc Jun 17, 2023
4bc3481
delete pkgcheck wf, it always fails
s3alfisc Jun 17, 2023
6bdbcf8
switch to collapse::qtab #117
s3alfisc Jun 17, 2023
b7dc2a6
faster computation of H #113
s3alfisc Jun 17, 2023
8e6b8ce
revert use of collapse::qtab, introduces test failures #117
s3alfisc Jun 18, 2023
9426c1e
clean up hc bootstrap #113
s3alfisc Jun 18, 2023
cfce367
add technical vignette #123
s3alfisc Jun 18, 2023
b7cda39
cleanups and update readme
s3alfisc Jun 18, 2023
cbaa84d
only use pinv when standard inversion fails
s3alfisc Jun 18, 2023
520628d
allow to project out cluster fixed effects for 11, 31 bootstrap types…
s3alfisc Jun 19, 2023
87cf286
move computation of H to rcpp
s3alfisc Jun 19, 2023
fa6acd6
update wildboottest.jl in test #107
s3alfisc Jun 20, 2023
91efcfe
more on cluster fixed effects #124
s3alfisc Jun 25, 2023
1b28140
clear error message when clustid != bootcluster for fastnreliable algos
s3alfisc Jun 25, 2023
fef4b7a
bump version, update news
s3alfisc Jun 25, 2023
80be119
update news, wild bootstrap 101 vignette
s3alfisc Jun 25, 2023
b02dcfc
update news
s3alfisc Jun 25, 2023
9ffad72
fix bug in boot_aggregate with HC errors
s3alfisc Jun 27, 2023
cd2275a
minor bug fixes
s3alfisc Jul 2, 2023
e79ba80
minor updates
s3alfisc Jul 2, 2023
347b2db
move fixest preprocessing to fixest::fetch_data
s3alfisc Jul 2, 2023
e5bc436
update news
s3alfisc Jul 2, 2023
ae4eef2
add congruent check
s3alfisc Jul 2, 2023
5e6b539
add error when running boottest() with varying slopes
s3alfisc Jul 2, 2023
d5bf18a
revert fetch_data for fixest
s3alfisc Jul 2, 2023
f7272a4
update news; wildboottests.jl installation
s3alfisc Jul 2, 2023
1a26b89
fix tests
s3alfisc Jul 2, 2023
7e70aa3
slightly clean up docs
s3alfisc Jul 2, 2023
6a3c121
update - drop cluster fixed demeaning feature
s3alfisc Jul 2, 2023
2ba4d9b
update readme
s3alfisc Jul 2, 2023
4561ba5
update readme
s3alfisc Jul 2, 2023
a827a79
fix cmd check
s3alfisc Jul 4, 2023
00aa28e
allow to project out cluster fixed effects
s3alfisc Jul 5, 2023
355047a
forgot this in last commit
s3alfisc Jul 5, 2023
00196e2
bug fix
s3alfisc Jul 6, 2023
77f0243
update news, bib
s3alfisc Jul 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:

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

Expand Down
20 changes: 15 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
Package: fwildclusterboot
Title: Fast Wild Cluster Bootstrap Inference for Linear Models
Version: 0.13.2
Version: 0.14.0
Authors@R: c(
person("Alexander", "Fischer", , "[email protected]", role = c("aut", "cre")),
person("David", "Roodman", role = "aut"),
person("Megha", "Joshi",
role = "rev",
comment = "Megha reviewed the package (v. 0.13) for ropensci
, see <https://github.com/ropensci/software-review/issues/546>"
),
person("Eunseop", "Kim",
role = "rev",
comment = "Eunseop reviewed the package (v. 0.13) for ropensci
, see <https://github.com/ropensci/software-review/issues/546>"
),
person("Achim", "Zeileis", role = "ctb",
comment = "Author of included sandwich fragments"),
person("Nathaniel", "Graham", role = "ctb",
Expand Down Expand Up @@ -42,7 +52,6 @@ Imports:
generics,
gtools,
JuliaConnectoR,
MASS,
Matrix,
Rcpp,
rlang,
Expand All @@ -64,7 +73,8 @@ Suggests:
rmarkdown,
sandwich,
testthat (>= 3.0.0),
tibble
tibble,
MASS
LinkingTo:
Rcpp,
RcppArmadillo,
Expand All @@ -77,9 +87,9 @@ Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE, roclets = c ("namespace", "rd",
"srr::srr_stats_roclet"))
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
SystemRequirements: Version Requirements to run the wild bootstrap through
Julia - Julia (>= 1.8), WildBootTests.jl (>=0.9). Julia is
Julia - Julia (>= 1.8), WildBootTests.jl (>=0.9.8). Julia is
downloadable via the official Julia website
(https://julialang.org/downloads/), WildBootTests.jl via Julia's
package manager (https://docs.julialang.org/en/v1/stdlib/Pkg/) or its
Expand Down
10 changes: 7 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ S3method(mboottest,lm)
S3method(nobs,boottest)
S3method(nobs,mboottest)
S3method(plot,boottest)
S3method(print,boottest)
S3method(print,mboottest)
S3method(pval,boottest)
S3method(pval,mboottest)
S3method(summary,boottest)
Expand All @@ -34,12 +32,18 @@ export(teststat)
export(tidy)
importFrom(JuliaConnectoR,juliaEval)
importFrom(JuliaConnectoR,juliaImport)
importFrom(MASS,ginv)
importFrom(Matrix,Diagonal)
importFrom(Matrix,Matrix)
importFrom(Matrix,crossprod)
importFrom(Matrix,sparse.model.matrix)
importFrom(Matrix,t)
importFrom(Matrix,tcrossprod)
importFrom(Rcpp,evalCpp)
importFrom(collapse,GRP)
importFrom(collapse,fmean)
importFrom(collapse,fsum)
importFrom(collapse,qF)
importFrom(collapse,qtab)
importFrom(dqrng,dqsample)
importFrom(dqrng,dqset.seed)
importFrom(dreamerr,check_arg)
Expand Down
36 changes: 35 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
# fwildclusterboot 0.14

## Breaking Changes

- the `print.boottest()` and `print.mboottest()` method have been deprecated, as both did not have a distinct use case.
- Bugfix: `boottest()` should never have run with `fixest::feols()` and
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.

## Performance

Version 0.14 ...

- sparsifies the "fast and reliable" bootstraps - bootstrap types 31, 33, 13 (which leads to good speed gains for problems with high dimensional fixed effects)
- allows to project out cluster fixed effects when running the "fast and reliable" algorithms "11" and "31"
- computes the generalized inverse `pinv` via rcpp eigen instead of `MASS::ginv()` whenever `Matrix::solve()` fails
- unlocks parallelization (nthreads was internally set to 1 for some reason)


## rOpenSci Review feedback

- update docs:
- add a vignette on wild bootstrap concepts (wild bootstrap 101)
- better explanation of plot method in docs and vignette
- some guidelines on how to turn messages and warnings off
- reorganization of ropensci ssr tags into code
- it is now possible to interrupt rcpp loops


## Misc

- throws a clear error message when the subcluster bootstrap is tried for the fast and reliable algos (currently not supported)
- bumps the required `WildBootTests.jl` version to `0.9.7`


# fwildclusterboot 0.13

## Potentially Breaking Changes:
Expand Down Expand Up @@ -308,7 +342,7 @@ I have spent some time to clean up `fwildclusterboot's` internals, which should
+ 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.
+ 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.
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.
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.
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.

+ 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.
+ Additionally, minor speed tweaks.
Expand Down
22 changes: 22 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@ boot_algo3_crv3 <- function(B, G, k, v, scores_mat, scores_boot, inv_tXX_tXgXg,
.Call('_fwildclusterboot_boot_algo3_crv3', PACKAGE = 'fwildclusterboot', B, G, k, v, scores_mat, scores_boot, inv_tXX_tXgXg, cores, R, delta_b_star)
}

convertSparse <- function(mat) {
.Call('_fwildclusterboot_convertSparse', PACKAGE = 'fwildclusterboot', mat)
}

compute_H <- function(G, R, tXXinv, tXgXg, scores_list, cores) {
.Call('_fwildclusterboot_compute_H', PACKAGE = 'fwildclusterboot', G, R, tXXinv, tXgXg, scores_list, cores)
}

pinv <- function(X) {
.Call('_fwildclusterboot_pinv', PACKAGE = 'fwildclusterboot', X)
}

#' Moore-Penrose Pseudo Inverses via Eigen
#' @param A a matrix
#' @return A matrix. Pseudo-Inverse of A.
#' @noRd
NULL

#' Matrix Multiplication via Eigen
#' @param A A matrix.
#' @param B A matrix.
Expand All @@ -19,6 +37,10 @@ eigenMapMatMult <- function(A, B, nthreads) {
.Call('_fwildclusterboot_eigenMapMatMult', PACKAGE = 'fwildclusterboot', A, B, nthreads)
}

eigen_pinv <- function(A) {
.Call('_fwildclusterboot_eigen_pinv', PACKAGE = 'fwildclusterboot', A)
}

#' Get maximum number of threads on hardware for open mp support
#' @noRd
cpp_get_nb_threads <- function() {
Expand Down
Loading