I found this question on a past exam and i wanted to know if my solution is correct! I apologize if it's not 100% clear but i'm translating it from italian and it's already written in a really bad form to begin with. Let's suppose that 10 rats are used in a biomedic study. Each of them is injected with poison and after that, they're injected with a serum that is supposed to increase their life duration. The life duration of the 10 rats (in months) is 14, 17, 27, 18,12, 8, 22, 13, 19 e 12. Let's suppose that we use an exponential distribution, calculate the maximum likelihood of the average life duration. This is my solution in matlab:
A = [14, 17, 27, 18,12, 8, 22, 13, 19, 12];
n = 10;
lambda = n/sum(A);
rats = zeros(10);
for i=1:n
rats(i) = lambda*exp(-lambda*A(i));
end
lambdais something like a rate while yourrats(i)gives ten likelihoods, that is presumably not the solution – Henry Jan 15 '22 at 10:56