diff --git a/scripts/ce089-09.R b/scripts/ce089-09.R index e4d11efc91ef374ed4b7c4932133d5c21a9ab953..fb6c6e40a5cb44e5f7dc1a655cfdadc02f83eacb 100644 --- a/scripts/ce089-09.R +++ b/scripts/ce089-09.R @@ -128,6 +128,12 @@ simul <- function(n_class = 3, tx_acer = 0.55, N = 1000) { mean(u) } +# Comparando teÃģrico com simulado. +k <- 13 +alpha <- 0.7 +sum(dbinom(ceiling(k/2):k, size = k, prob = alpha)) +simul(n_class = k, tx_acer = alpha, N = 10000) + # Grid de valores nos parÃĒmetros da simulaçÃĢo. grid <- expand.grid(n_class = c(3, 5, 9, 13, 19, 25), tx_acer = seq(0.35, 0.95, by = 0.025)) @@ -150,9 +156,19 @@ xyplot(acc ~ tx_acer, title = "#Classif.", cex.title = 1), grid = TRUE, - type = "o") + + type = "p") + layer({ panel.abline(v = 0.5, h = 0.5, lty = 2) + }) + + glayer({ + k <- group.value + p <- sapply(x, + FUN = function(alpha) { + sum(dbinom(ceiling(k/2):k, + size = k, + prob = alpha)) + }) + panel.lines(x, p, col = col.line) }) #-----------------------------------------------------------------------