tests/testthat/test-calcWeights.R

context("Weights calculation")

test_that("Weights sum to one",{
    n = 20; p = 50; B = 1e2
    mat = matrix(rnorm(n*p), n, p)
    x = sample(c(0,1), n , replace = TRUE)
    expect_equal(sum(reconsi(mat, x)$Weights), 1)
})
CenterForStatistics-UGent/rransi documentation built on Nov. 13, 2023, 2:07 a.m.