Skip to content

Commit

Permalink
Avoid warnings [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
paulnorthrop committed Aug 24, 2019
1 parent ada3698 commit 2a4db89
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions vignettes/lax-vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ bibliography: lax.bib
knitr::opts_chunk$set(comment = "#>", collapse = TRUE)
```

```{r, echo = FALSE}
got_evd <- requireNamespace("evd", quietly = TRUE)
got_evir <- requireNamespace("evir", quietly = TRUE)
got_extRemes <- requireNamespace("extRemes", quietly = TRUE)
got_fExtremes <- requireNamespace("fExtremes", quietly = TRUE)
got_ismev <- requireNamespace("ismev", quietly = TRUE)
got_POT <- requireNamespace("POT", quietly = TRUE)
got_texmex <- requireNamespace("texmex", quietly = TRUE)
```

The [CRAN Task View on Extreme Value Analysis](https://CRAN.R-project.org/view=ExtremeValue) provides information about R packages that perform various extreme value analyses. The *lax* package supplements the functionality of seven of these packages, namely
[evd](https://cran.r-project.org/package=evd) [@evd],
[evir](https://cran.r-project.org/package=evir) [@evir],
Expand Down Expand Up @@ -101,6 +91,10 @@ anova(adj_large, adj_small, type = "none")

We see that the adjustment of the loglikelihood for clustering makes enough of a difference to matter: if we perform a test at the 5\% significance level then we choose the larger model when we adjust but the smaller model if we do not.

```{r, echo = FALSE}
got_texmex <- requireNamespace("texmex", quietly = TRUE)
```

## texmex

```{r, eval = got_texmex}
Expand All @@ -117,6 +111,10 @@ detach("package:texmex")

## evd

```{r, echo = FALSE}
got_evd <- requireNamespace("evd", quietly = TRUE)
```

The `fgev()` function in *evd* fits GEV regression models, but it only allows covariate effects in the location parameter.

```{r, eval = got_evd}
Expand All @@ -132,6 +130,10 @@ detach("package:evd")

## extRemes

```{r, echo = FALSE}
got_extRemes <- requireNamespace("extRemes", quietly = TRUE)
```

```{r, eval = got_extRemes}
library(extRemes)
fevd_fit <- fevd(temp, ow, location.fun = ~ ow$loc, scale.fun = ~ ow$loc,
Expand All @@ -146,6 +148,10 @@ detach("package:extRemes")

## evir

```{r, echo = FALSE}
got_evir <- requireNamespace("evir", quietly = TRUE)
```

The `gev()` function in *evir* only fits stationary GEV models.

```{r, eval = got_evir}
Expand All @@ -161,6 +167,10 @@ detach("package:evir")

## fExtremes

```{r, echo = FALSE}
got_fExtremes <- requireNamespace("fExtremes", quietly = TRUE)
```

The `gevFit()` function in *fExtremes* only fits stationary GEV models.

```{r, eval = got_fExtremes}
Expand All @@ -176,6 +186,10 @@ detach("package:fExtremes")

## POT

```{r, echo = FALSE}
got_POT <- requireNamespace("POT", quietly = TRUE)
```

Among other things, the `fitgpd()` function in the *POT* package can fit a GP distribution to threshold excesses using maximum likelihood estimation. We illustrate `alogLik` using an example from the `fitgpd` documentation. There is no cluster dependence here. However, there may be interest in using a sandwich estimator of covariance if we are concerned about model misspecification. In this case, where we simulate from the correct model, we expect the adjustment to make little difference, and so it proves.

```{r, eval = got_POT}
Expand Down

0 comments on commit 2a4db89

Please sign in to comment.