# NOT RUN {
tt <- seq(0, 10, len = 21)
ncp <- seq(0, 6, len = 31)
dt3R <- outer(tt, ncp, dt, df = 3)
dt3JKB <- outer(tt, ncp, dntJKBf, df = 3)
all.equal(dt3R, dt3JKB)
# }
# NOT RUN {
<!-- % This is already in ../tests/t-nonc-tst.R --- TODO: drop here or there ?! -->
# }
# NOT RUN {
x <- seq(-1,12, by=1/16)
fx <- dt(x, df=3, ncp=5)
re1 <- 1 - .dntJKBch(x, df=3, ncp=5) / fx # with warnings
re2 <- 1 - dntJKBf (x, df=3, ncp=5) / fx
stopifnot(all.equal(re1[!is.na(re1)], re2[!is.na(re1)], tol=1e-6))
matplot(x, log10(abs(cbind(re1, re2))), type = "o", cex = 1/4)
# }
Run the code above in your browser using DataLab