I use Math.NET all the time, and they do have some nice regression fitting routines. Check out their examples:
https://numerics.mathdotnet.com/Regression.htmlNow nothing in Math.NET does plotting, only curve fitting. If you need to plot (Do you?), and you're writing a Performance Visualizer (Are you?), then I would check out:
https://code.msdn.microsoft.com/mschartIf you need a plot and you're not writing a Performance Visualizer, then I would use either Excel or R. Both interface with any .NET application like Weath-Lab. Excel might be easier to get started with, but if you already have R installed, then I would use that instead. And R does regression fitting too, which is a good option if you are
not wanting to do fitting as part of your strategy code. (Personal note: The regression fitting I do
is part of my strategy execution, so I use Math.NET exclusively for that.)
I can post my WL library routine for fitting y = beta00*1/x + beta0 + beta1*x with Math.NET if that helps, which covers raising x to powers of -1, 0, and 1 as you can see from the equation. I skip including the x² term because that's too sensitive to outlier behavior. You "might" include a (ln x) or exp(x) term in there, but I wouldn't put too many degrees of freedom in your regression model because that would over fit it for a fuzzy system problem.
---
I just had a wild and crazy idea. If it's possible to define a 2D double array:
CODE:
Please log in to see this code.
and store it in the WL global cache, then one may be able to write a general purpose Performance Visualizer to plot some arbitrary 2D thing easily. The Performance Visualizer should probably purge the xyScatterPlot array after plotting so it's not stuck in the cache. There might some conflicts if two separate strategy instances try writing into the same global array simultaneously. Hmm, that's a down side of employing the WL global cache. Well, you could define your own protected strategy 2D array in the
constructor of the strategy that wants to make the xyScatterPlot. But then that strategy instance will have to exist when the Performance Visualizer tries to plot it. Is that a problem?