Likelihood Ratio test of Gumbel vs. GEV
LRGumbel.test(x,
alternative = c("frechet", "GEV"),
method = c("num", "sim", "asymp"),
nSamp = 1500,
simW = FALSE)
A list of results with elements statistic
, p.value
and method
. Other elements are
Character describing the alternative hypothesis.
If simW
is TRUE
and method
is "sim"
only. A vector of nSamp
simulated values of the statistic
\(W := -2 \log \textrm{LR}\).
Numeric vector of sample values.
Character string describing the alternative distribution.
Method used to compute the \(p\)-value.
Number of samples for a simulation, if method
is
"sim"
.
Logical. If this is set to TRUE
and method
is "sim"
, the simulated values are returned as
an element W
in the list.
Yves Deville
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 method
is "num"
, a numerical approximation
of the distribution is used.
When method
is "sim"
, nSamp
samples of
the Gumbel distribution with the same size as x
are 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 method
is "asymp"
, the asymptotic
distribution is used.
set.seed(1234)
x <- rgumbel(60)
res <- LRGumbel.test(x)
Run the code above in your browser using DataLab