|
From: | Richardson, Anthony |
Subject: | qfunc/qfuncinv implementation in communications package |
Date: | Thu, 24 Jan 2013 19:26:01 +0000 |
The function qfunc() in the communications package is currently implemented as: y = 1-normcdf(x); This returns 0 for values of x greater than approx. 8 (where normcdf() is close to 1). I believe a better implementation is: y = erfc(x/sqrt(2))/2; A simple test to compare the two implementations is: x = [0:3:18]; [qfunc(x); erfc(x/sqrt(2))/2] Can the implementation of qfunc() be changed please? The function qfuncinv() suffers from similar problems (it returns Inf for small arguments). I had hoped just rewriting it in terms of erfcinv() would fix this problem too, but I found that erfcinv() is implemented in the specfun package
as: y= erfinv(1 – x) which exhibits problems for small values of x (due to the subtraction from 1). A better implementation of erfcinv is needed, but I don’t know what that would be. Tony Richardson |
[Prev in Thread] | Current Thread | [Next in Thread] |