|
From: | Przemek Klosowski |
Subject: | Re: qfunc/qfuncinv implementation in communications package |
Date: | Thu, 24 Jan 2013 15:59:59 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
On 01/24/2013 02:26 PM, Richardson, Anthony wrote:
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]
Octave 3.6.3 returns zero for both forms: [x=[0:3:18]' qfunc(x) erfc(x/sqrt(2))/2] 0.000000000000000 0.500000000000000 0.500000000000000 3.000000000000000 0.001349898031630 0.001349898031630 6.000000000000000 0.000000000986588 0.000000000986588 9.000000000000000 0.000000000000000 0.000000000000000 12.000000000000000 0.000000000000000 0.000000000000000 15.000000000000000 0.000000000000000 0.000000000000000 18.000000000000000 0.000000000000000 0.000000000000000
[Prev in Thread] | Current Thread | [Next in Thread] |