I have a dataframe with 3 columns: Y, X1, X2. I want to find the parameter estimates b1 and b2 by minimizing the sum of squares according to:
Objective function: minimize the sum of squares (Y - (b1*X1 + b2*X2))^2
Constraints: 0 < b1 < 2, 0 < b2 < 1
Initial guesses: b1=b2=0.5
Technique: Newton-Raphson
I know that I can use
scipy.optimize.minimize(fun, x0, args=(), method=None, jac=None, hess=None, hessp=None, bounds=None, constraints=(), tol=None, callback=None, options=None)
but I can't see how to pass the columns from the dataframe in as all the examples I found from searching don't use columns from a dataframe.
I would be very grateful for any help.