tests/testthat/test_lfhtcID.R

library(SEMID)
context("Testing that latent-factor half-trek criterion function for generic identifiability works properly.")

source("graphExamples.R")

test_that("lfhtcID returns correct value for known examples.", {
  for (i in 1:length(digraphExamples)) {
    res = lfhtcID(digraphExamples[[i]]$graph)
    lfhtcid = (sum(sapply(res$unsolvedParents, length)) == 0)
    # TRUE = LF-HTC-identifiable, FALSE = not LF-HTC-identifiable
    expect_equal(lfhtcid, digraphExamples[[i]]$lfhtcid)
  }
})

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.