# Estimating the parameter $\beta$

The lifetime of computer monitors has a exponential distribution where the expected value can be written as: $$\mu(s) = \frac{\beta}{s}$$

Where $$s$$ is how bright the monitor is and both $$s$$ and $$\beta$$ are >0

How do I estimate the maximum-likelihood of parameter $$\beta$$?

I know that the log-likelihood for a exponential distribution is:

$$l(\lambda) = n(\ln(\lambda) - \lambda\bar{t})$$

And taking the derivative and equals it to zero yields:

$$\frac{dl(\lambda)}{d\lambda} = n(\frac{1}{\lambda} - \bar{t}) = 0$$

$$\bar{t} = \frac{1}{\lambda}$$

Here is where I get stuck.

EDIT 1

I have data for both the lifetime of the computer monitors and their brightness.

• You need data about s. Nov 24 at 17:49
• Yes i have data, i will make that clear in the question. Thanks.
– 0xcc
Nov 24 at 17:50
• Is the sample independent? Nov 24 at 17:52
• Yes, I assume it is.
– 0xcc
Nov 24 at 17:52
• I still should come up with some expression for the likelihood of $\beta$?
– 0xcc
Nov 24 at 17:53

To estimate the $$\beta$$ by the maximum likelihood method, let $$Y_1,\ldots, Y_n$$ be the sample of lifetimes, with $$Y_i\sim \text{Exp}(\beta/s_i)$$, s.t. $$E(Y_i) = \beta/s_i$$ and independently for each $$i$$, where $$s_i$$ is the monitor brightness.

Then the likelihood function for $$\beta$$ is given by

$$L(\beta) = \prod_{i=1}^n (s_i/\beta) e^{-\frac{1}{\beta}s_i Y_i} \propto \beta^{-n} e^{-\frac{1}{\beta}\sum_is_iY_i}.$$

I leave the rest to you...

• Thank you, but there is something i don't understand, first, you plug in that $\lambda = \frac{\beta}{s}$, should it not be the inverse? That is $\lambda = \frac{s}{\beta}$ since the mean of a exponential distribution is: $\frac{1}{\lambda}$ Also if i continue with your calculations i get that the log-likelihood is : $l(\beta) = n \ln(\beta) \sum_i{\frac{Y_i}{s_i}}$ Taking it's derivative and setting it equal it to zero yields: $l'(\beta) = \frac{1}{\beta} n\sum_i{\frac{Y_i}{s_i}} = 0$, which seems wrong?
– 0xcc
Nov 24 at 18:23
• You are right @0xcc, I was using a different reparametrization, not the one you are working with. See the updated answer. Nov 24 at 18:43
• Ok so i think i got it, the expression for the log-likelihood is: $-\ln(\beta) - \frac{\sum_i{Y_i s_i}}{\beta}$ So i want to try maximize that with respect to $\beta$ given my data?
– 0xcc
Nov 24 at 19:46
• almost...its $-n\ln\beta-\cdots$ Nov 24 at 19:47
• Wow now i got it, @utobi you are fantastic! Thank you.
– 0xcc
Nov 24 at 19:48

$$L(\beta) = P(\mathrm{Data} \mid \beta) = \prod_i f(x_i)$$ and $$\lambda = \frac{1}{\mu} = \frac{s}{\beta}$$

Log is increasing so maximizing log is same as maximizing likelihood: $$\ell(\beta) = \sum \log f(x_i).$$

$$\log f(x_i) = \log \lambda e^{-\lambda x_i} = \log s - \log \beta - \frac{s}{\beta}x_i$$

and

\frac{d}{d \beta} \log f = -\frac{1}{\beta} - \frac{s}{\beta^2}x_i.

So,

\frac{d}{d \beta}\ell(\beta) = -\frac{n}{\beta} - \frac{s}{\beta^2}\sum x_i = 0

gives

\hat{\beta} = \frac{s}{n}\sum x_i = s \bar{x}.

Note: the second derivative of $$\ell$$ is positive since $$x_i, s, \beta>0$$ so LL is concave.

• Note that this is a question tagged [self-study] and our policy is to not provide full answers but only hints. Nov 24 at 19:27
• Thank you, I was not aware of that policy. Nov 24 at 19:31
• You are welcome! see here Nov 24 at 19:34
• I removed my downvote. Could you please explain why you downvoted my answer? Nov 24 at 19:42
• Sorry, it was a mistake; I tried to change it to an upvote but couldn't since it was not edited since my vote. If you make a small edit I will! Nov 24 at 21:42

Assise from using a direct derivation, leading to a closed form expression, you can do this with a generalized linear model a description is given in the question

Fitting exponential (regression) model by MLE?

With that approach you have more flexibility (e.g. change the function $$\mu(s)$$)

### Example

In R you would use the function glm with the family gamma and specify a dispersion parameter dispersion=1 (the exponential distribution is a special case of the gamma distribution for which the dispersion parameter is equal to 1).

### generate and plot data

set.seed(1)
n = 100
x = runif(n,0,10)
mu = 2/x
rate = 1/mu
y = rexp(n,rate)
plot(x,y)

#### fit glm model with Gamma distribution that has k=1 (ie. the exponential distribution)

fit = glm(y ~ 0+x, family = Gamma())
summary(fit,dispersion=1)

# This gives as result
# a rate parameter of lambda = 0.49868 x
# which relates to
# a mean that is mu = 1/lambda = 2.005294/x