x <- rpois(100, 11)
nl1 <- nlogL_pois(x, 11)
nl2 <- nlogL_pois(x, 13)
x <- rnbinom(100, size = 13, mu = 9)
nl <- nlogL_nb(x, c(13, 9))
x <- gamlss.dist::rDEL(100, mu = 5, sigma = 0.2, nu= 0.5)
nl <- nlogL_del(x, c(5, 0.2, 0.5))
x <- gamlss.dist::rPIG(100, mu = 5, sigma = 0.2)
nl <- nlogL_pig(x, c(5, 0.2))
x <- rpb(n = 1000, alpha=5, beta= 3, c=20)
nl <- nlogL_pb(x, c(5, 3, 20))
s <- sample(x = c(0,1), size = 100, replace = TRUE, prob = c(0.3,0.7))
x <- s*rpois(100, 7) + (1-s)*rpois(100, 13)
nl <- nlogL_pois2(x, c(0.3, 13, 7))
s <- sample(x = c(0,1), size = 100, replace = TRUE, prob = c(0.3,0.7))
x <- s*rnbinom(100, size = 13, mu = 9) + (1-s)*rnbinom(100, size = 17, mu = 29)
nl <- nlogL_nb2(x, c(0.3, 17, 29, 13, 9))
s <- sample(x = c(0,1), size = 100, replace = TRUE, prob = c(0.3,0.7))
x <- s * gamlss.dist::rDEL(100, mu = 5, sigma = 0.2, nu = 0.5) +
(1 - s) * gamlss.dist::rDEL(100, mu = 20, sigma = 2, nu = 0.1)
nl <- nlogL_del2(x, c(0.7,5, 0.2, 20, 2))
s <- sample(x = c(0,1), size = 100, replace = TRUE, prob = c(0.3,0.7))
x <- s * gamlss.dist::rPIG(100, mu = 5, sigma = 0.2) +
(1 - s) * gamlss.dist::rPIG(100, mu = 20, sigma = 2)
nl <- nlogL_pig2(x, c(0.7, 5, 0.2, 20, 2))
s <- sample(x = c(0,1), size = 100, replace = TRUE, prob = c(0.3,0.7))
x <- s*rpb(100, 5, 3, 20) + (1-s)*rpb(100, 7, 13, 53)
nl <- nlogL_pb2(x, c(0.7, 7, 13, 53, 5, 3, 20))
x <- c(rep(0, 10), rpois(90, 7))
nl <- nlogL_zipois(x, c(0.1, 7))
x <- c(rep(0,10), rnbinom(90, size = 13, mu = 9))
nl <- nlogL_zinb(x, c(0.1, 13, 9))
x <- c(rep(0,10), gamlss.dist::rDEL(90, mu = 13, sigma = 2, nu = 0.5))
nl <- nlogL_zidel(x, c(0.1, 13, 2, 0.5))
x <- c(rep(0,10), gamlss.dist::rPIG(90, mu = 13, sigma = 2))
nl <- nlogL_zipig(x, c(0.1, 13, 2))
x <- c(rep(0, 10), rpb(n = 90, alpha=5, beta= 3, c=20))
nl <- nlogL_zipb(x, c(0.1, 5, 3, 20))
s <- sample(x = c(0, 1), size = 90, replace = TRUE, prob = c(0.3, 0.7))
x <- c(rep(0, 10), s * rpois(90, 7) + (1 - s) * rpois(90, 13))
nl1 <- nlogL_zipois2(x, c(0.1, 0.63, 7, 13))
s <- sample(x = c(0, 1), size = 90, replace = TRUE, prob = c(0.3, 0.7))
x <- c(rep(0, 10), s * rnbinom(90, size = 13, mu = 9) + (1 - s) * rnbinom(90, size = 17, mu = 29))
nl <- nlogL_zinb2(x, c(0.1, 0.63, 13, 9, 17, 29))
s <- sample(x = c(0, 1), size = 90, replace = TRUE, prob = c(0.3, 0.7))
x <- c(rep(0, 10), s * gamlss.dist::rDEL(90, mu = 13, sigma = 9, nu = 0.5) +
(1 - s) * gamlss.dist::rDEL(90, mu = 17, sigma = 29, nu = 0.1))
nl <- nlogL_zidel2(x, c(0.1, 0.63, 13, 9, 0.5, 17, 29, 0.1))
s <- sample(x = c(0,1), size = 90, replace = TRUE, prob = c(0.3, 0.7))
x <- c(rep(0, 10), s * gamlss.dist::rPIG(90, mu = 13, sigma = 0.2) +
(1-s) * gamlss.dist::rPIG(90, mu = 17, sigma = 2))
nl <- nlogL_zipig2(x, c(0.1, 0.63, 13, 0.2, 17, 2))
s <- sample(x = c(0,1), size = 90, replace = TRUE, prob = c(0.3,0.7))
x <- c(rep(0,10), s*rpb(90, 5, 3, 20) + (1-s)*rpb(90, 7, 13, 53))
nl <- nlogL_zipb2(x, c(0.1, 0.63, 7, 13, 53, 5, 3, 20))
Run the code above in your browser using DataLab