@@ -166,50 +166,57 @@ These estimates can be found by maximizing the likelihood function given the
166
166
data.
167
167
168
168
The pdf of a lognormally distributed random variable $X$ is given by:
169
+
169
170
$$
170
171
f(x) = \frac{1}{x}\frac{1}{\sigma \sqrt{2\pi}} exp\left(\frac{-1}{2}\left(\frac{\ln x-\mu}{\sigma}\right)\right)^2
171
172
$$
172
173
173
174
Since $\ln X$ is normally distributed this is the same as
175
+
174
176
$$
175
177
f(x) = \frac{1}{x} \phi(x)
176
178
$$
179
+
177
180
where $\phi$ is the pdf of $\ln X$ which is normally distibuted with mean $\mu$ and variance $\sigma ^2$.
178
181
179
182
For a sample $x = (x_1, x_2, \cdots, x_n)$ the _likelihood function_ is given by:
183
+
180
184
$$
181
185
\begin{aligned}
182
- L(\mu, \sigma | x_i) = \prod_ {i=1}^{n} f(\mu, \sigma | x_i) \\
183
- L(\mu, \sigma | x_i) = \prod_ {i=1}^{n} \frac{1}{x_i} \phi(\ln x_i)
186
+ L(\mu, \sigma | x_i) & = \prod_ {i=1}^{n} f(\mu, \sigma | x_i) \\
187
+ & = \prod_ {i=1}^{n} \frac{1}{x_i} \phi(\ln x_i)
184
188
\end{aligned}
185
189
$$
186
190
191
+
187
192
Taking $\log$ on both sides gives us the _log likelihood function_ which is:
193
+
188
194
$$
189
195
\begin{aligned}
190
- l(\mu, \sigma | x_i) = -\sum_ {i=1}^{n} \ln x_i + \sum_ {i=1}^n \phi(\ln x_i) \\
191
- l(\mu, \sigma | x_i) = -\sum_ {i=1}^{n} \ln x_i - \frac{n}{2} \ln(2\pi) - \frac{n}{2} \ln \sigma^2 - \frac{1}{2\sigma^2}
192
- \sum_ {i=1}^n (\ln x_i - \mu)^2
196
+ \ell(\mu, \sigma | x_i) &= -\sum_ {i=1}^{n} \ln x_i + \sum_ {i=1}^n \phi(\ln x_i) \\
197
+ &= -\sum_ {i=1}^{n} \ln x_i - \frac{n}{2} \ln(2\pi) - \frac{n}{2} \ln \sigma^2 - \frac{1}{2\sigma^2} \sum_ {i=1}^n (\ln x_i - \mu)^2
193
198
\end{aligned}
194
199
$$
195
200
196
201
To find where this function is maximised we find its partial derivatives wrt $\mu$ and $\sigma ^2$ and equate them to $0$.
197
202
198
203
Let's first find the MLE of $\mu$,
204
+
199
205
$$
200
206
\begin{aligned}
201
- \frac{\delta l}{\delta \mu} = - \frac{1}{2\sigma^2} \times 2 \sum_ {i=1}^n (\ln x_i - \mu) = 0 \\
202
- \Rightarrow \ sum_ {i=1}^n \ln x_i - n \mu = 0 \\
203
- \Rightarrow \ hat{\mu} = \frac{\sum_ {i=1}^n \ln x_i}{n}
207
+ \frac{\delta l}{\delta \mu} = - \frac{1}{2\sigma^2} \times 2 \sum_ {i=1}^n (\ln x_i - \mu) & = 0 \\
208
+ \sum_ {i=1}^n ( \ln x_i - n \mu) & = 0 \\
209
+ \hat{\mu} & = \frac{\sum_ {i=1}^n \ln x_i}{n}
204
210
\end{aligned}
205
211
$$
206
212
207
213
Now let's find the MLE of $\sigma$,
214
+
208
215
$$
209
216
\begin{aligned}
210
- \frac{\delta l}{\delta \sigma^2} = - \frac{n}{2\sigma^2} + \frac{1}{2\sigma^4} \sum_ {i=1}^n (\ln x_i - \mu)^2 = 0 \\
211
- \Rightarrow \ frac{n}{2\sigma^2} = \frac{1}{2\sigma^4} \sum_ {i=1}^n (\ln x_i - \mu)^2 \\
212
- \Rightarrow \ hat{\sigma} = \left( \frac{\sum_ {i=1}^{n}(\ln x_i - \hat{\mu})^2}{n} \right)^{1/2}
217
+ \frac{\delta l}{\delta \sigma^2} = - \frac{n}{2\sigma^2} + \frac{1}{2\sigma^4} \sum_ {i=1}^n (\ln x_i - \mu)^2 & = 0 \\
218
+ \frac{n}{2\sigma^2} & = \frac{1}{2\sigma^4} \sum_ {i=1}^n (\ln x_i - \mu)^2 \\
219
+ \hat{\sigma} & = \left( \frac{\sum_ {i=1}^{n}(\ln x_i - \hat{\mu})^2}{n} \right)^{1/2}
213
220
\end{aligned}
214
221
$$
215
222
@@ -266,7 +273,6 @@ tr_lognorm
266
273
times as large.)
267
274
268
275
269
-
270
276
## Pareto distribution
271
277
272
278
We mentioned above that using maximum likelihood estimation requires us to make
0 commit comments