[BF/UT] fix old doctest for mapestimate
[BF/UT] fix old doctest for mapestimate

Here we have slightly different numerical values than what is specified in the
test.

A bisect gave us the origin of the new values:

zsh» git bisect start master snap-2010-12-08
...
683e8e00c5752d6db06615acc1c848f5dc165e05 is the first bad commit
commit 683e8e00c5752d6db06615acc1c848f5dc165e05
Author: Ingo Fründ <ingo.fruend@googlemail.com>
Date:   Thu Dec 9 18:26:44 2010 +0100

    C++[NF] optimize and bootstrap use new starting point routines

    :040000 040000 94ef7ea4f02cec063d20606ec29e3f9aa5b16150
    42a40039713975570f7587cc13a4c0f659d72f26 M  src

using the following script (bisect.py):

import swignifit.interface_methods as interface
import unittest as ut

class TestMapestimate(ut.TestCase):
    def test_old_doctest(self):
        x = [float(2*k) for k in xrange(6)]
        k = [34,32,40,48,50,48]
        n = [50]*6
        d = [[xx,kk,nn] for xx,kk,nn in zip(x,k,n)]
        priors = ('flat','flat','Uniform(0,0.1)')
        estimate, fisher, thres, slope, deviance = interface.mapestimate ( d, priors=priors )
        for i,value in enumerate([ 2.75183178, 1.45728231, 0.01555514]):
            self.assertAlmostEqual(value, estimate[i])
        self.assertAlmostEqual(2.75183178, thres)
        self.assertAlmostEqual(8.0713313969, deviance)

We then compared this to the psignifit2 output using:

0.0 34 50
2.0 32 50
4.0 40 50
6.0 48 50
8.0 50 50
10.0 48 50

'#shape logistic
'#n_intervals 2
'#runs 999
'
'#lambda_limits 0, 0.1
'#cuts 0.5
'#conf 0.1 0.9
'
'#write_st_sim dummy

zsh» psignifit bisect.dat bisect.prefs
psi(x) = gamma + (1 - gamma - lambda) * F(x, alpha, beta)
using logistic function for F and assuming 2AFC design (gamma = 0.5)
lambda is constrained within [0, 0.1]
fitting to original data
initial: {alpha = 2.74362, beta = 1.57066, gamma = 0.5, lambda = 0.01}
  final: {alpha = 2.7478, beta = 1.46061, gamma = 0.5, lambda = 0.0154096}
  running 999 simulations using fitted parameters
  Stats for generating distribution:
      D = 8.07148,  r_pd = -0.179898, r_kd = -0.5485
      random seed: 1309964903
      0.14 seconds.

Since the new deviance is still less than the old deviance we conclude that the
optimizer is doing the right thing™ and changed the expected values to the
current output. Hopefully it does not fail on 32-bit.

esc/Psignifit-3.x,esc/Psignifit-3.x,esc/Psignifit-3.x,esc/Psignifit-3.x,esc/Psignifit-3.x,esc/Psignifit-3.x