Мне нужно добавить ограничение к моей линейной регрессии ниже, чтобы y_pred [i]> = y_pred [i + 1]
from patsy import dmatrix
import statsmodels.api as sm
xknot = dmatrix("bs(x, knots=(0.0001,1,2,4,6,8,9.3), degree=3, include_intercept=False)",
{"x": x},return_type='dataframe')
fit = sm.GLM(y, xknot).fit()
y_pred = fit1.predict(dmatrix("bs(x, knots=(0.0001,1,2,4,6,8,9.3), include_intercept=False)",
{"x": x}, return_type='dataframe')) ```