cancel
Showing results for 
Search instead for 
Did you mean: 

Constrained Curve Fitting in KDB

jattwick
New Contributor II

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.

1 ACCEPTED SOLUTION

megan_mcp
Community Manager Community Manager
Community Manager

Hi @jattwick,

This looks similar to Polynomial fitting - lsq – least-squares matrix equation solution |Reference | kdb+ and q documentation - Kdb+ and q docu...

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!

View solution in original post

2 REPLIES 2

megan_mcp
Community Manager Community Manager
Community Manager

Hi @jattwick,

This looks similar to Polynomial fitting - lsq – least-squares matrix equation solution |Reference | kdb+ and q documentation - Kdb+ and q docu...

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!

jattwick
New Contributor II

Thank you @megan_mcp ! 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.