def breakpoint_linear(x, ts, k1, k2, c1):
'''Function representing a step-wise linear curve with one
breakpoint located at ts.
'''
return np.piecewise(x, [x < ts], [lambda x: k1 * x + c1,
lambda x: k2 * x + (k1 - k2) * ts + c1])
评论列表
文章目录