Gompertz 增长模型,有没有数学上,证明下该模型有效性或者思路的?
y=a*bcT
项目中哪些因素对结果有影响,如 加班因素、人员变更
# coding: UTF-8
import numpy as np
from scipy.optimize import leastsq
###采样点
ti=np.array(xrange(1,23))
#yi=np.array([7,10,21,23,24,50,91,120.140,154,171,201,220,224,239.247,256,274,295,325,346,353,369,386,424,484,534,
# 582,621,636,708,736,800,863,932,965,1001,1042,1082])
#3,4,12,13,14,23,42,62,72,76,87,107,117,118,127
yi=np.array([152,168,194,206,213,225,242,280,336,382,429,466,479,548,
572,626,683,748,778,813,847,885])
def func(p,t):
a,b,c=p
return a*b**(c**t)
def error(p,t,y,s):
print s
return func(p,t)-y
p0=[1500,0.078,0.874]
s="Test the number of iteration"
para=leastsq(error,p0,args=(ti,yi,s))
a,b,c=para[0]
print 'a=',a,'b=',b,'c=',c
import matplotlib.pyplot as plt
plt.figure(figsize=(8,6))
plt.scatter(ti,yi,color='red',label='Sample Point',linewidth=3)
t=np.linspace(0,80,1000)
y=a*b**(c**t)
plt.plot(t,y,color='orange',label='fitting Point',linewidth=2)
plt.legend()
plt.show()