Skip to content

Commit 243ae3a

Browse files
committed
Update the FAQ vignette: add blanck lines before and after blocks of latex equations
1 parent 8834fa8 commit 243ae3a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: vignettes/FAQ.Rmd

+8-1
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,29 @@ Yes, an example with the Burr distribution is detailed in the JSS paper. We repr
8787
```{r, message=FALSE}
8888
data("endosulfan")
8989
library("actuar")
90-
fendo.B <- fitdist(endosulfan$ATV, "burr", start = list(shape1 = 0.3, shape2 = 1, rate = 1))
90+
fendo.B <- fitdist(endosulfan$ATV, "burr", start = list(shape1 = 0.3,
91+
shape2 = 1, rate = 1))
9192
summary(fendo.B)
9293
```
9394

9495
## Why there are differences between MLE and MME for the lognormal distribution?
9596
We recall that the lognormal distribution function is given by
97+
9698
$$
9799
F_X(x) = \Phi\left(\frac{\log(x)-\mu}{\sigma} \right),
98100
$$
101+
99102
where $\Phi$ denotes the distribution function of the standard normal distribution.
100103
We know that $E(X) = \exp\left( \mu+\frac{1}{2} \sigma^2 \right)$
101104
and $Var(X) = \exp\left( 2\mu+\sigma^2\right) (e^{\sigma^2} -1)$.
102105
The MME is obtained by inverting the previous formulas, whereas
103106
the MLE has the following explicit solution
107+
104108
$$
105109
\hat\mu_{MLE} = \frac{1}{n}\sum_{i=1}^n \log(x_i),~~
106110
\hat\sigma^2_{MLE} = \frac{1}{n}\sum_{i=1}^n (\log(x_i) - \hat\mu_{MLE})^2.
107111
$$
112+
108113
Let us fit a sample by MLE and MME. The fit looks particularly good in both cases.
109114

110115
```{r, fig.height=3.5, fig.width=7}
@@ -117,11 +122,13 @@ denscomp(list(f1, f2), demp=TRUE, main = "Density plot")
117122
```
118123

119124
Let us compare the theoretical moments (mean and variance) given the fitted values
125+
120126
($\hat\mu,\hat\sigma$), that is
121127
$$
122128
E(X) = \exp\left( \hat\mu+\frac{1}{2} \hat\sigma^2 \right),
123129
Var(X) = \exp\left( 2\hat\mu+\hat\sigma^2\right) (e^{\hat\sigma^2} -1).
124130
$$
131+
125132
```{r}
126133
c("E(X) by MME"=as.numeric(exp(f2$estimate["meanlog"]+f2$estimate["sdlog"]^2/2)),
127134
"E(X) by MLE"=as.numeric(exp(f1$estimate["meanlog"]+f1$estimate["sdlog"]^2/2)),

0 commit comments

Comments
 (0)