Finding mistake in likelihood function and likelihood

83 Views Asked by At

pmf =$e^{{(-(y-a)/b)-e^{-((y-a)/b)}}}$

liklihood function = $e^{-((\sum\limits_{n=1}^{\infty} y_n)-na/b)}*e^{-e^{(a/b)}*(\sum\limits_{n=1}^{\infty} e^{(y_n/b)}})$

log likelihood function in r = +-((sum(y)-length(y)p[1])/p[2])-exp((p[1]/p[2])(sum(exp(-y/p[2])))) where p[1]=a and p[2]=b

I suspect that my likelihood function is incorrect because when I optim in R it gives an impossible interval.

1

There are 1 best solutions below

2
On BEST ANSWER

I think you are talking about the Gumbel distribution whose probability density function (pdf) is of the form

$$f(y\,;a,b)=\frac{1}{b}\exp\left[-\frac{(y-a)}{b}-e^{-(y-a)/b}\right]\quad,\,y\in\mathbb R\quad,\,a\in\mathbb R,b>0$$

, where I assume the parameter $(a,b)$ to be unknown.

This is not a pmf but a pdf (it is a continuous distribution) and you can see that the normalising constant $b$ is missing in your equations.

If $Y_1,Y_2,\ldots,Y_n$ are independent and identically distributed random variables having the above distribution, then the likelihood function given the sample $(y_1,y_2,\ldots,y_n)\in\mathbb R^n$ is

\begin{align} L(a,b)&=\prod_{i=1}^n f(y_i\,;a,b) \\&=\frac{1}{b^n}\exp\left[-\frac{1}{b}\sum_{i=1}^n (y_i-a)-\sum_{i=1}^n e^{-(y_i-a)/b}\right]\quad,\,a\in\mathbb R,b>0 \end{align}

So the log-likelihood is

\begin{align} \ell(a,b)&=-n\ln b-\frac{1}{b}\sum_{i=1}^n (y_i-a)-\sum_{i=1}^n e^{-(y_i-a)/b} \\&=-n\ln b-\frac{n}{b}(\bar y-a)-e^{a/b}\sum_{i=1}^n e^{-y_i/b} \qquad[\,\bar y=\text{ sample mean }] \end{align}