|
|
@ -1216,6 +1216,7 @@ class RegLogit(object):
|
|
|
|
g = np.maximum(y == y.max(), g)
|
|
|
|
g = np.maximum(y == y.max(), g)
|
|
|
|
g1 = np.minimum(y > y.min(), g1)
|
|
|
|
g1 = np.minimum(y > y.min(), g1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
p = g - g1
|
|
|
|
p = g - g1
|
|
|
|
dev = -2 * sum (np.log(p));
|
|
|
|
dev = -2 * sum (np.log(p));
|
|
|
|
#return dev, p, g, g1
|
|
|
|
#return dev, p, g, g1
|
|
|
@ -1300,6 +1301,15 @@ def _test_reslife():
|
|
|
|
mrl = reslife(R, nu=20)
|
|
|
|
mrl = reslife(R, nu=20)
|
|
|
|
mrl.plot()
|
|
|
|
mrl.plot()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_reglogit():
|
|
|
|
|
|
|
|
y=np.array([1, 1, 2, 1, 3, 2, 3, 2, 3, 3])
|
|
|
|
|
|
|
|
x = np.arange(10).T
|
|
|
|
|
|
|
|
b = reglogit(y,x)
|
|
|
|
|
|
|
|
b.display() % members and methods
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
b.summary()
|
|
|
|
|
|
|
|
[mu,plo,pup] = b.predict();
|
|
|
|
|
|
|
|
plot(x,mu,'g',x,plo,'r:',x,pup,'r:')
|
|
|
|
def main():
|
|
|
|
def main():
|
|
|
|
#_test_dispersion_idx()
|
|
|
|
#_test_dispersion_idx()
|
|
|
|
import doctest
|
|
|
|
import doctest
|
|
|
@ -1307,4 +1317,6 @@ def main():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
|
|
|
pass
|
|
|
|
main()
|
|
|
|
main()
|
|
|
|
|
|
|
|
|
|
|
|