Hello Rmetrics Core Team:

 

I think I've found a small bug in the q=qsnorm(p,mean=,sd=,xi=) function
of the fGarch R package. The symptoms are that the output, q, is
incorrect and even discontinuous around p=0.5 for xi > 1 (and probably
also for xi < 1; I haven't checked). 

 

Changing "1/2" to "g/xi/2" in the following 2 lines of the function
.qsnorm() fixes the issue:

 

Change "sig = sign(p-1/2)" to "sig = sign(p-g/xi/2)"

Change "p = (Heaviside(p-1/2)-sig*p) / (g*Xi)" to "p =
(Heaviside(p-g/xi/2)-sig*p) / (g*Xi)"

 

Explanation: sign(z) and Heaviside(z) are used correctly in the
.psnorm() function. The qsnorm() function is the inverse of the psnorm()
function, but p was incorrectly substituted for z in the sign() and
Heaviside() functions.

 

Thanks,

-Eric

 

 

---------------------------

Eric K. Sutton, PhD

Research Physicist

AFRL/RVBXI

(505) 846-7846

DSN 246-7846

 


	[[alternative HTML version deleted]]

