I am trying to solve this problem:
Assuming for the phishing values to come from a Poisson distribution of unknown lambda parameter, use the sample values to numerically estimate the parameter with the method of maximum likelihood, compare it with what you would have with the method of moments and with this estimate calculate the probability of having carried out more phishing than the first quartile of those present in test;
What I know is that for continuous random variables it is sufficient to rewrite in R the function of the specific distribution (or its logarithmic version), then through a for loop to multiply all the densities for each x_i belonging to the sample,
and for discrete distributions instead? if I were faced with a Bernoulli distribution (for example), or a Poisson distribution like the one in the exercise above, what should I do?
Note: this is not a duplicate of MSE and MLE with Poisson distribution, I'm my case I'm asking relative to R, more than a single theoretical explanation
L_pois = function(lambda) (lambda^sum(k) / factorial(sum(k)))*exp(-lambda) lam = mean(k) qpois(p=1/4, lambda = lam)
(referring to the cited exercise) $\endgroup$