Fwd: [R] problem with 'dgev' in fExtremes with log=TRUE

Gaz D grothered at gmail.com
Mon Sep 26 17:02:16 CEST 2011


Hi,
The emails below describe what appears to be a problem with dgev in fExtremes.
Thanks,
Gareth


---------- Forwarded message ----------
From: R. Michael Weylandt <michael.weylandt at gmail.com>
Date: Tue, Sep 27, 2011 at 12:33 AM
Subject: Re: [R] problem with 'dgev' in fExtremes with log=TRUE
To: Gaz D <grothered at gmail.com>


Seems entirely reasonable to me. I'd suggest you send a copy of this
message to the package maintainer's email -- maintainer("fExtremes")
-- and hopefully they can get on it pretty quickly since it's an
obvious fix and log functionality is already implemented for the .devd
internals.

Thanks for bringing this to my attention - I use this package from
time to time and had never noticed this.

On Mon, Sep 26, 2011 at 9:04 AM, Gaz D <grothered at gmail.com> wrote:
>
> Hi,
>
> The function 'dgev' in the 'fExtremes' package contains a 'log'
> argument, for returning the log of the gev density. For example:
>
> > library(fExtremes)
> > x = seq(100,1000)
> > density_values_log = dgev(x, 0.21, 455, 150, log=TRUE)
> > density_values_nolog = dgev(x, 0.21, 455, 150, log=FALSE)
>
> However, in my experience, the function seems to always assume that 'log=FALSE':
>
> > range(density_values_log-density_values_nolog)
> [1] 0 0
>
> If we look at the code for 'dgev', it seems that 'log=FALSE' is actually always
> passed to the '.devd' function, which does the density calculation
>
> > dgev
> function (x, xi = 1, mu = 0, beta = 1, log = FALSE)
> {
>    d = .devd(x, location = mu, scale = beta, shape = xi, log = FALSE)
>    attr(d, "control") = data.frame(xi = xi, mu = mu, beta = beta,
>        log = log, row.names = "")
>    d
> }
>
> I did these computations using fExtremes version 2100.77 (downloaded a few
> weeks ago), on windows 7, 64Bit, R 2.13.1
>
> Does this require a change to the fExtremes code -- or am I making some error?
>
> Thanks,
> Gareth Davies
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the Rmetrics-core mailing list