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)
})

Try the reconsi package in your browser

Any scripts or data that you put into this service are public.

reconsi documentation built on Nov. 8, 2020, 5:04 p.m.