# NOT RUN {
## Poisson mixture
x = rnppois(200, disc(c(1,4), c(0.7,0.3)))
r = cnm(x)
plotgrad(x, r$mix)
## Normal mixture
x = rnpnorm(200, disc(c(0,4), c(0.3,0.7)), sd=1)
r = cnm(x, init=list(beta=0.5)) # sd = 0.5
plotgrad(x, r$mix, r$beta)
# }
Run the code above in your browser using DataLab