From software at iangregory.com  Thu Jul 12 09:28:20 2007
From: software at iangregory.com (software at iangregory.com)
Date: Thu, 12 Jul 2007 09:28:20 +0200 (CEST)
Subject: [Rd] Fextremes - Error in if (xi > 0.5) (PR#9789)
Message-ID: <20070712072820.C29A45A80D@slim.kubism.ku.dk>

Full_Name: Ian Gregory
Version: 2.41
OS: Widnows XP 64
Submission from: (NULL) (58.110.160.141)


Fextremes version: 240.10068

gpdFit(c(98,99,100),threshold=100,type="pwm")

Gives this error:
Error in if (xi > 0.5) { : missing value where TRUE/FALSE needed

This error will occur whenever a threshold value will choose a cut-off which
will have identical raw values above the cut-off.  
In the example above; the raw values would all be the same and not exist.
A larger example would identify say a cut-off at 96% and produce the error.

Line 62-66 of the function GPD:

if (xi > 0.5) {
	denom <- NA
        warning("Asymptotic standard errors not available for", 
        "PWM Method when xi > 0.5")
}


Two fixes:

(1)
Change this line:
if (xi > 0.5) {
to
if (xi > 0.5 || xi==NA) {

(2)
Change this line:
warning("Asymptotic standard errors not available for",
to:
warning("Asymptotic standard errors not available for ",

ie.  add a space after for.

Thank you,

Ian Gregory
Sydney University



[Rd] Fextremes - Error in if (xi > 0.5) (PR#9789)
software at iangregory.com