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

Loading…
Cancel
Save