# OLS regression user defined function in Python

Is there a way to handle complex functions for OLS regression in Python? For example, if my function is $y = a - bx^{c} + e^{dx}$, then how I can use a Python library to estimate $a,b,c$ and $d$?

i have looked at statsmodel but there isn't a way, to the best of my knowledge, to achieve this.

Yes, check out the scipy.optimize package:
https://docs.scipy.org/doc/scipy-0.15.1/reference/optimize.html

http://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html