Likelihood Ratio test for the Gumbel distribution
LRGumbel.test.RdLikelihood Ratio test of Gumbel vs. GEV
Arguments
- x
-
Numeric vector of sample values.
- alternative
-
Character string describing the alternative distribution.
- method
-
Method used to compute the \(p\)-value.
- nSamp
-
Number of samples for a simulation, if
methodis"sim". - simW
-
Logical. If this is set to
TRUEandmethodis"sim", the simulated values are returned as an elementWin the list.
Value
A list of results with elements statistic, p.value
and method. Other elements are
- alternative
-
Character describing the alternative hypothesis.
- W
-
If
simWisTRUEandmethodis"sim"only. A vector ofnSampsimulated values of the statistic \(W := -2 \log \textrm{LR}\).
Details
The asymptotic distribution of the Likelihood-ratio statistic is known. For the GEV alternative, this is a chi-square distribution with one df. For the Fréchet alternative, this is the distribution of a product \(XY\) where \(X\) and \(Y\) are two independent random variables following a Bernoulli distribution with probability parameter \(p = 0.5\) and a chi-square distribution with one df.
When
methodis"num", a numerical approximation of the distribution is used.When
methodis"sim",nSampsamples of the Gumbel distribution with the same size asxare drawn and the LR statistic is computed for each sample. The \(p\)-value is simply the estimated probability that a simulated LR is greater than the observed LR. This method requires more computation time than the tow others.Finally when
methodis"asymp", the asymptotic distribution is used.
Note
For the Fréchet alternative, the distribution of the test statistic has mixed type: it can take any positive value as well as the value \(0\) with a positive probability mass. The probability mass is the probability that the ML estimate of the GEV shape parameter is negative.
When method is "sim", the computation can be slow
because each of the nSamp simulated values requires two
optimisations. The "asymp" method provides an acceptable
precision for \(n \geq 50\), and may even be used for
\(n \geq 30\).
Examples
set.seed(1234)
x <- rgumbel(60)
res <- LRGumbel.test(x)