Skip to content

Commit

Permalink
FT: #59 change number of iterations in test for res. boot. that is fa…
Browse files Browse the repository at this point in the history
…iling
  • Loading branch information
ricfog committed Mar 31, 2021
1 parent 1783c7b commit 323202a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/test-ols-boot-residual.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ test_that("test sample mean of coefficients estimated via bootstrap matches the
})

test_that('variance is 0 when the model is well-specified and sample size is large',{
n <- 1e4
n <- 3e4
X <- stats::rnorm(n, 0, 1)
# OLS data and model
y <- 2 + X * 1 + stats::rnorm(n, 0, 1)
lm_fit <- stats::lm(y ~ X)
boot_out <- comp_boot_res(lm_fit, B = 1e3)$boot_out %>% tidyr::unnest(cols = boot_out)
expect_equal(boot_out %>% dplyr::group_by(term) %>%
dplyr::summarize(sd_estimate = sd(estimate)) %>%
dplyr::summarize(sd_estimate = var(estimate)) %>%
dplyr::pull(sd_estimate) %>% unname(),
c(0,0), tol = 1e-2)
})
Expand Down

0 comments on commit 323202a

Please sign in to comment.