Constrained optimization of cubic polynomial

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sammo
    New Member
    • Aug 2010
    • 2

    Constrained optimization of cubic polynomial

    Hi all,

    I'm new to Python (and to coding in general). If anyone can help out with the problem below or point me in the right direction I'd really appreciate it.

    I have a noisy dataset through which I'd like to fit the best possible cubic polynomial using the least squares method. numpy.polyfit is almost what I want, but for physical reasons there are some additional constraints on the curve:

    1. It should pass through the origin (0, 0) and

    2. All of the coefficients should be non-negative.

    Basically I want to fit a curve of the form

    y = ax**3 + bx**2 + cx where a, b and c are all >= 0

    Is there a way of using numpy.polyfit with these additional constraints, or is there another method entirely that's accessible to a relative beginner?

    Thanks very much for any help or advice!
  • dwblas
    Recognized Expert Contributor
    • May 2008
    • 626

    #2
    I would also try the numpy list http://www.scipy.org/Mailing_Lists This is beyond me but perhaps someone else will have some insights.

    Comment

    • Sammo
      New Member
      • Aug 2010
      • 2

      #3
      Thanks dwblas, I'll try the numpy list too.

      Comment

      Working...