R Under development (unstable) (2024-09-18 r87177 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 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. > # set.seed(123) > # > # library(Qval) > # library(ddpcr) > # > # ## generate Q-matrix and data > # K <- 5 > # I <- 20 > # IQ <- list( > # P0 = runif(I, 0.1, 0.3), > # P1 = runif(I, 0.7, 0.9) > # ) > # > # QRR1 <- QRR2 <- 0 > # times <- 1 > # for(t in 1:times){ > # quiet({ > # Q <- sim.Q(K, I) > # data <- sim.data(Q = Q, N = 500, IQ = IQ, model = "GDINA", distribute = "horder") > # Y <- data$da > # > # ## simulate random mis-specifications > # MQ <- sim.MQ(Q, 0.1) > # > # CDM.obj <- CDM(data$dat, MQ) > # GDINA.obj <- CDM.obj$analysis.obj > # > # obj1 <- validation(data$dat, MQ, CDM.obj, method = "Hull", search.method = "ESA") > # obj2 <- validation(data$dat, MQ, CDM.obj, method = "Hull", search.method = "PAA") > # }) > # > # QRR1 <- QRR1 + zQRR(Q, obj1$Q.sug) > # QRR2 <- QRR2 + zQRR(Q, obj2$Q.sug) > # cat(t, ": QRR.1 =", round(QRR1/t, 3), " QRR.2 =", round(QRR2/t, 3), "\n") > # } > # > # > # # { > # # Hull[is.nan(Hull)] <- 0 > # # number.of.parameters <- c(0, npk[c(which(Hull>0)+1, K+1)]) > # # fit.index <- c(0, criterion[c(which(Hull>0)+1, K)]) > # # plot(number.of.parameters, fit.index, type = "o", main = "Hull plot") > # # } > > proc.time() user system elapsed 0.10 0.04 0.14