y = rpois(100,10);
out = generalized_poisson_likelihood(y);
#Check if it converged
if(out$mark==1)
{
#Value of Theta
cat("theta = ",out$theta,"lambda = ",out$lambda,"lambda_poisson = ",out$y_bar,"Length = ",out$length,"\n");
}
Run the code above in your browser using DataLab