Constrained regression in Python
问题 I have this simple regression model: y = a + b * x + c * z + error with a constraint on parameters: c = b - 1 There are similar questions posted on SO (like Constrained Linear Regression in Python). However, the constraints' type is lb <= parameter =< ub . What are the available options to handle this specific constrained linear regression problem? 回答1: This is how it can be done using GLM: import statsmodels import statsmodels.api as sm import numpy as np # Set the link function to identity