Skip to content

v0.14

Latest
Compare
Choose a tag to compare
@s3alfisc s3alfisc released this 08 Jul 08:25
· 10 commits to master since this release
add82ae

fwildclusterboot 0.14

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 (thanks to @kylebutts)
  • unlocks parallelization (nthreads was internally set to 1 for some reason)

Here is a performance benchmark for the "31" bootstrap between version 0.13 and 0.14: the runtime of the bootstrap decreases from 150s to around 10 seconds!

library(fwildclusterboot)
library(fixest)

df <- fwildclusterboot:::create_data(
  N = 1000000,
  N_G1 = 50, 
  icc1 = 0.2, 
  N_G2 = 50, 
  icc2 = 0.5, 
  numb_fe1 = 100, 
  numb_fe2 = 100, 
  seed = 123
)

nrow(df)
# [1] 1000000
sapply(df[, c("group_id1", "Q1_immigration", "Q2_defense")], function(x) length(unique(x)))
# group_id1 Q1_immigration     Q2_defense 
# 50            100            100 

fit <- feols(
  proposition_vote ~ treatment | group_id1 + Q1_immigration + Q2_defense, 
  data = df
)

# fwildclusterboot 0.13: 
pracma::tic()
boottest(
  fit, 
  param = ~ treatment,
  B = 9999, 
  clustid = ~group_id1, 
  bootstrap_type = "31"
)
pracma::toc()
# elapsed time is 158.550000 seconds 

# fwildclusterboot 0.14: 
pracma::tic()
boottest(
  fit, 
  param = ~ treatment,
  B = 9999, 
  clustid = ~group_id1, 
  bootstrap_type = "31"
)
pracma::toc()
# elapsed time is 11.460000 seconds 

Breaking Changes

  • the print.boottest() and print.mboottest() method have been deprecated, as both did not really do anything that the summary() method would not do. Note: this was a bad decision, and I will revert it in version 0.14.1.
  • 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.

rOpenSci Review feedback link

  • 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 (version 0.9.6 contained a small bug when fixed effects where used within the bootstrap via the fe argument of boottest().