tests/testthat/test_globalID.R

library(SEMID)
context("Testing that function for global identifiability works properly.")

source("graphExamples.R")

test_that("globalID returns correct value for known examples.", {
    for (i in 1:length(graphExamples)) {
        graphExample <- graphExamples[[i]]
        L <- graphExample$L
        O <- graphExample$O
        globalId <- graphExample$globalId
        m <- nrow(L)

        result <- globalID(MixedGraph(L,O))
        if (globalId == 1) {
            expect_true(result)
        } else {
            expect_false(result)
        }
    }
})

Try the SEMID package in your browser

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

SEMID documentation built on July 26, 2023, 5:40 p.m.