R version 4.5.0 RC (2025-04-04 r88113 ucrt) -- "How About a Twenty-Six" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ############################################################################# > ## ## > ## Tests for deprecated function ## > ## ## > ############################################################################# > > ## --- Load test routines and test parameters ------------------------------- > > source("test_routines.R") > > ## --- DISCR: Chi^2 goodness-of-fit test ------------------------------------ > > ## DGT (Discrete Guide Table method) > size <- 100 > prob <- 0.3 > binom.pmf <- function (x) { dbinom(x, size, prob) } > binom.probs <- dbinom(0:size, size, prob) > urdgt.binom <- function (n,lb=0,ub=size) { + urdgt(n, probvector=binom.probs) + } > unur.test.discr("urdgt.binom", rfunc=urdgt.binom, dfunc=binom.pmf, domain=c(0,size)) urdgt.binom() domain=(0,100): chisq test PASSed with p-value=0.849828 > unur.test.discr("urdgt.binom", rfunc=urdgt.binom, pv=binom.probs, domain=c(0,size)) urdgt.binom() domain=(0,100): chisq test PASSed with p-value=0.347114 > rm(urdgt.binom) > rm(size,prob,binom.pmf,binom.probs) > > ## DAU (Discrete Alias-Urn method) > size <- 100 > prob <- 0.3 > binom.pmf <- function (x) { dbinom(x, size, prob) } > binom.probs <- dbinom(0:size, size, prob) > urdau.binom <- function (n,lb=0,ub=size) { + urdau(n, probvector=binom.probs) + } > unur.test.discr("urdau.binom", rfunc=urdau.binom, dfunc=binom.pmf, domain=c(0,size)) urdau.binom() domain=(0,100): chisq test PASSed with p-value=0.717268 > unur.test.discr("urdau.binom", rfunc=urdau.binom, pv=binom.probs, domain=c(0,size)) urdau.binom() domain=(0,100): chisq test PASSed with p-value=0.192565 > rm(urdau.binom) > rm(size,prob,binom.pmf,binom.probs) > > ## -- Print statistics ------------------------------------------------------ > > unur.test.statistic() Tests for discrete distributions number of tests = 4 (number of warnings = 0 ) > > ## -- End ------------------------------------------------------------------- > > detach("package:Runuran",unload = TRUE) > > ## -------------------------------------------------------------------------- > > proc.time() user system elapsed 0.48 0.10 0.59