Where is the LinearRegression(List) routine documented? A search for it in Help, QuickRef, and forum turns up nothing. I want to know what the return values are.
Rename
It’s currently undocumented.
In case you refer to the LinearRegression() function mentioned in the forum thread about Lars' K-Ratio :
LinearRegression() is part of the math library available for formula metric's expressions. It is documented along with the "Insert Identifier" dialog of these expressions:

The first variant (highlighted) assumes a series [1, 2, 3.. , N-1] as second input series for the linear regression.
Furthermore, in this context all members of the Math.Numerics namespace are available.
LinearRegression() is part of the math library available for formula metric's expressions. It is documented along with the "Insert Identifier" dialog of these expressions:
The first variant (highlighted) assumes a series [1, 2, 3.. , N-1] as second input series for the linear regression.
Furthermore, in this context all members of the Math.Numerics namespace are available.
Thanks for that reply. That screenshot documents LinearRegression(List) well. Where did you find that window in the screenshot? I can't find it.
Also, VS Object Browser says LinearRegression(List) is part of the WealthLab.Core namespace rather than the Math.Numerics namespace. Why is that? I'm assuming Math.Numerics is a separate package.... Right?
Also, VS Object Browser says LinearRegression(List) is part of the WealthLab.Core namespace rather than the Math.Numerics namespace. Why is that? I'm assuming Math.Numerics is a separate package.... Right?
There are two. The LinearRegression is WealthLab.Core is a simple utility class. It has two constructors, one accepts a List<double> and another List<Point>.
The PredictValue method predicts the value of Y for the X value passed in the parameter (either an int or a double.)
That's all there is to it.
The PredictValue method predicts the value of Y for the X value passed in the parameter (either an int or a double.)
That's all there is to it.
QUOTE:
There are two.
Okay. So the WealthLab.Core version has nothing to do with the Math.Numerics version. And the Math.Numerics one is a separate install. Thanks for the clarification.
What's confusing is the screenshot in Reply# 2 looks like it's coming from a WealthLab window, but you're telling me that's not the case. Interesting.
I'm using MathNet.Numerics myself, which is a separate install. It does multi-variant linear regression very well.
QUOTE:
Where did you find that window in the screenshot?
This window is part of the finantic.ScoreCard extension. (see https://www.wealth-lab.com/extension/detail/finantic.ScoreCard)
The LinearRegression(series) is part of a library specially tailored for use in metric formulas.
This library also comes with the finantic.ScoreCard extension.
It uses MathNet.Numerics internally.
QUOTE:
I'm assuming Math.Numerics is a separate package.... Right?
While MathNet.Numerics is a separate DLL, this DLL comes with WL7. It is useable from any coded strategy and from extensions.
Just add:
CODE:to your C# code.
using MathNet.Numerics;
QUOTE:
While MathNet.Numerics is a separate DLL,...
MathNet.Numerics is a great package. I've been using it with WL6 for a couple years. I also use it with WL7. My Local.Components.dll library for WL6 and WL7 calls MathNet.Numerics for regression and statistics. Got to find those particular solutions.
QUOTE:
... this DLL comes with WL7.
Perhaps one has to have the finantic.ScoreCard extension installed to get that MathNet DLL installed automatically. I currently don't have that ScoreCard extension, but I'm interested in it. Thanks for all the clarification.
I did a clean install of WL7 and it puts MathNet.Numerics.DLL into the installation folder:

QUOTE:
I did a clean install of WL7 and it puts MathNet.Numerics.DLL into the installation folder
Your install date matches mine, 1/7/2021. Interesting.
I'll still need the nuGet MathNet.Numerics package for WL6 projects though. But I'll redirect my WL7 projects to use the MathNet.Numerics.dll in the WL7 install directory instead. Thanks for pointing that out.
Your Response
Post
Edit Post
Login is required