Changed doctest for normndprb into a unittest

master
pbrod 9 years ago
parent 3495621f69
commit 4fd4e5349e

@ -123,21 +123,21 @@ def test_prbnormndpc():
def test_prbnormnd(): def test_prbnormnd():
'''
>>> import numpy as np Et = 0.001946 # exact prob.
>>> Et = 0.001946 # # exact prob. n = 5
>>> n = 5 Blo = -np.inf
>>> Blo =-np.inf; Bup=-1.2 Bup = -1.2
>>> m = np.zeros(n); rho = 0.3; m = np.zeros(n)
>>> Sc =(np.ones((n,n))-np.eye(n))*rho+np.eye(n) rho = 0.3
>>> A = np.repeat(Blo,n) Sc = (np.ones((n, n)) - np.eye(n)) * rho + np.eye(n)
>>> B = np.repeat(Bup,n)-m A = np.repeat(Blo, n)
>>> [val,err,inform] = prbnormnd(Sc,A,B) B = np.repeat(Bup, n) - m
>>> np.abs(val-Et)< err [val, err, _inform] = prbnormnd(Sc, A, B)
True assert(np.abs(val - Et) < err)
>>> 'val = %2.5f' % val
'val = 0.00195' t = 'val = %2.5f' % val
''' assert(t == 'val = 0.00195')
def test_cdfnorm2d(): def test_cdfnorm2d():

Loading…
Cancel
Save