/
index.html
209 lines (191 loc) · 14.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Loglikelihood Adjustment for Extreme Value Models • lax</title>
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/paper/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="bootstrap-toc.css">
<script src="bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script><meta property="og:title" content="Loglikelihood Adjustment for Extreme Value Models">
<meta property="og:description" content="Performs adjusted inferences based on model objects fitted, using
maximum likelihood estimation, by the extreme value analysis packages
eva <https://cran.r-project.org/package=eva>,
evd <https://cran.r-project.org/package=evd>,
evir <https://cran.r-project.org/package=evir>,
extRemes <https://cran.r-project.org/package=extRemes>,
fExtremes <https://cran.r-project.org/package=fExtremes>,
ismev <https://cran.r-project.org/package=ismev>,
mev <https://cran.r-project.org/package=mev>,
POT <https://cran.r-project.org/package=POT> and
texmex <https://cran.r-project.org/package=texmex>.
Adjusted standard errors and an adjusted loglikelihood are provided, using
the chandwich package <https://cran.r-project.org/package=chandwich>
and the object-oriented features of the sandwich package
<https://cran.r-project.org/package=sandwich>. The adjustment is based on a
robust sandwich estimator of the parameter covariance matrix, based on the
methodology in Chandler and Bate (2007) <doi:10.1093/biomet/asm015>. This
can be used for cluster correlated data when interest lies in the
parameters of the marginal distributions, or for performing inferences that
are robust to certain types of model misspecification. Univariate extreme
value models, including regression models, are supported. ">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#toc">
<div class="container template-home">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">lax</a>
<span class="version label label-danger" data-toggle="tooltip" data-placement="bottom" title="Unreleased version">1.2.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fas fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/lax-vignette.html">An overview of lax</a>
</li>
</ul>
</li>
<li>
<a href="news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/paulnorthrop/lax/">
<span class="fab fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="contents col-md-9">
<div id="lax" class="section level1">
<div class="page-header"><h1 class="hasAnchor">
<a href="#lax" class="anchor"></a>lax</h1></div>
<div id="loglikelihood-adjustment-for-extreme-value-models" class="section level2">
<h2 class="hasAnchor">
<a href="#loglikelihood-adjustment-for-extreme-value-models" class="anchor"></a>Loglikelihood Adjustment for Extreme Value Models</h2>
<div id="what-does-lax-do" class="section level3">
<h3 class="hasAnchor">
<a href="#what-does-lax-do" class="anchor"></a>What does lax do?</h3>
<p>The <a href="https://CRAN.R-project.org/view=ExtremeValue">CRAN Task View on Extreme Value Analysis</a> provides information about R packages that perform various extreme value analyses. The <em>lax</em> package supplements the univariate extreme value modelling, including regression modelling, provided by 9 of these packages, namely <a href="https://cran.r-project.org/package=eva">eva</a>, <a href="https://cran.r-project.org/package=evd">evd</a>, <a href="https://cran.r-project.org/package=evir">evir</a>, <a href="https://cran.r-project.org/package=extRemes">extRemes</a>, <a href="https://cran.r-project.org/package=fExtremes">fExtremes</a>, <a href="https://cran.r-project.org/package=ismev">ismev</a>, <a href="https://cran.r-project.org/package=mev">mev</a>, <a href="https://cran.r-project.org/package=POT">POT</a> and <a href="https://cran.r-project.org/package=texmex">texmex</a>. <em>lax</em> works in an object-oriented way, operating on R objects returned from functions in other packages that summarise the fit of an extreme value model. It uses the <a href="https://cran.r-project.org/package=chandwich">chandwich</a> package to provide robust sandwich estimation of parameter covariance matrix and loglikelihood adjustment for models fitted by maximum likelihood estimation. This is performed by an <code>alogLik</code> S3 method, illustrated by the following example.</p>
</div>
<div id="an-example" class="section level3">
<h3 class="hasAnchor">
<a href="#an-example" class="anchor"></a>An example</h3>
<p>This example is based on the analysis presented in Section 5.2 of <a href="https://doi.org/10.1093/biomet/asm015">Chandler and Bate (2007)</a>. The data, which are available in the data frame <code>ow</code>, are a bivariate time series of annual maximum temperatures, recorded in degrees Fahrenheit, at Oxford and Worthing in England, for the period 1901 to 1980. If interest is only in the marginal distributions of high temperatures in Oxford and Worthing, then we might fit a GEV regression model in which some or all of the parameters may vary between Oxford and Worthing. However, we should adjust for the cluster dependence between temperatures recorded during the same year.</p>
<p>The following code fits such a model using the <code>evm</code> function in the <a href="https://cran.r-project.org/package=texmex">texmex</a> package and the uses <code>alogLik</code> to perform adjusted inferences.</p>
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://paulnorthrop.github.io/lax/">lax</a></span><span class="op">)</span>
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://github.com/harrysouthworth/texmex">texmex</a></span>, quietly <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span>
<span class="co"># Fit a GEV model with separate location, scale and shape for Oxford and Worthing</span>
<span class="co"># Note: phi = log(scale)</span>
<span class="va">evm_fit</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/texmex/man/evm.html">evm</a></span><span class="op">(</span><span class="va">temp</span>, <span class="va">ow</span>, <span class="va">gev</span>, mu <span class="op">=</span> <span class="op">~</span> <span class="va">loc</span>, phi <span class="op">=</span> <span class="op">~</span> <span class="va">loc</span>, xi <span class="op">=</span> <span class="op">~</span><span class="va">loc</span><span class="op">)</span>
<span class="co"># Adjust the loglikelihood and standard errors</span>
<span class="va">adj_evm_fit</span> <span class="op"><-</span> <span class="fu"><a href="reference/alogLik.html">alogLik</a></span><span class="op">(</span><span class="va">evm_fit</span>, cluster <span class="op">=</span> <span class="va">ow</span><span class="op">$</span><span class="va">year</span>, cadjust <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span>
<span class="co"># MLEs, SEs and adjusted SEs</span>
<span class="fu"><a href="https://rdrr.io/r/base/summary.html">summary</a></span><span class="op">(</span><span class="va">adj_evm_fit</span><span class="op">)</span>
<span class="co">#> MLE SE adj. SE</span>
<span class="co">#> mu: (Intercept) 81.17000 0.32820 0.40360</span>
<span class="co">#> mu: loc 2.66800 0.32820 0.21280</span>
<span class="co">#> phi: (Intercept) 1.30600 0.06091 0.06490</span>
<span class="co">#> phi: loc 0.14330 0.06091 0.05074</span>
<span class="co">#> xi: (Intercept) -0.19900 0.04937 0.03943</span>
<span class="co">#> xi: loc -0.08821 0.04937 0.03624</span></code></pre></div>
<p>An object returned from <code>aloglik</code> is a function to evaluate the adjusted loglikelihood, with <code>anova</code>, <code>coef</code>, <code>confint</code>, <code>logLik</code>, <code>nobs</code>, <code>plot</code>, <code>print</code>, <code>summary</code> and <code>vcov</code> methods.</p>
</div>
<div id="installation" class="section level3">
<h3 class="hasAnchor">
<a href="#installation" class="anchor"></a>Installation</h3>
<p>To get the current released version from CRAN:</p>
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a></span><span class="op">(</span><span class="st">"lax"</span><span class="op">)</span></code></pre></div>
</div>
<div id="vignette" class="section level3">
<h3 class="hasAnchor">
<a href="#vignette" class="anchor"></a>Vignette</h3>
<p>See <code><a href="articles/lax-vignette.html">vignette("lax-vignette", package = "lax")</a></code> for an overview of the package.</p>
</div>
</div>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<div class="links">
<h2>Links</h2>
<ul class="list-unstyled">
<li>Download from CRAN at <br><a href="https://cloud.r-project.org/package=lax">https://cloud.r-project.org/package=lax</a>
</li>
<li>Browse source code at <br><a href="https://github.com/paulnorthrop/lax/">https://github.com/paulnorthrop/lax/</a>
</li>
<li>Report a bug at <br><a href="https://github.com/paulnorthrop/lax/issues">https://github.com/paulnorthrop/lax/issues</a>
</li>
</ul>
</div>
<div class="license">
<h2>License</h2>
<ul class="list-unstyled">
<li>GPL (>= 2)</li>
</ul>
</div>
<div class="developers">
<h2>Developers</h2>
<ul class="list-unstyled">
<li>Paul J. Northrop <br><small class="roles"> Author, maintainer, copyright holder </small> </li>
<li>Camellia Yin <br><small class="roles"> Author, copyright holder </small> </li>
</ul>
</div>
<div class="dev-status">
<h2>Dev status</h2>
<ul class="list-unstyled">
<li><a href="https://ci.appveyor.com/project/paulnorthrop/lax"><img src="https://ci.appveyor.com/api/projects/status/github/paulnorthrop/lax?branch=master&svg=true" alt="AppVeyor Build Status"></a></li>
<li><a href="https://codecov.io/github/paulnorthrop/lax?branch=master"><img src="https://codecov.io/github/paulnorthrop/lax/coverage.svg?branch=master" alt="Coverage Status"></a></li>
<li><a href="https://cran.r-project.org/package=lax"><img src="https://www.r-pkg.org/badges/version/lax" alt="CRAN_Status_Badge"></a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p>Developed by Paul J. Northrop, Camellia Yin.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>
</div>
</body>
</html>