Constrained Curve Fitting in KDB

https://learninghub.kx.com/forums/topic/constrained-curve-fitting-in-kdb

Anyone have (or know of) an implementation of constrained curve fitting in KDB?

Similar to this scipy.optimize.curve_fit SciPy v1.11.1 Manual in python.

Hi ,

This looks similar to Polynomial fitting - lsq least-squares matrix equation solution |Reference | kdb+ and q documentation - Kdb+ and q documentation (kx.com)

Or another option is to use embedPy (or the PyKX version PyKX under Q) to import a Python library and use it directly. Running PyKX under q - PyKX

Let me know if this helps!

Thank you ! the lsq won’t fit our use case since we want the coefficients to be strictly greater than zero.

We’ll have a look at embedPy - was just hoping somebody had possibly written a native kdb implementation already.